NodeSource Node.js Binary Distributions |
curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash -
sudo yum install -y nodejs
node -v
mkdir discord-bot
cd discord-bot
npm install discord.js @discordjs/rest discord-api-types
直接執行 BOT 不是不行,但一旦關掉 PuTTY BOT 就會一起被關掉
nohup node index.js &
所以用 nohup 讓程式執行在背景就可以不用一直連著甲骨文雲端 Server
直接執行 BOT 不是不行,但一旦關掉 PuTTY BOT 就會一起被關掉
nohup node index.js &
所以用 nohup 讓程式執行在背景就可以不用一直連著甲骨文雲端 Server
這點很重要,我之前用 nohup 開麥塊 Server 的時候都是直接按叉叉關閉 PuTTY,但這次在用 Discord Bot 的時候發現儘管已經 nohup 了,叉叉 PuTTY 之後 Bot 還是會被關掉。查了萬能的 stackoverflow 之後發現只要乖乖的用 exit 離開 PuTTY 就行了。
exit
同標籤作品搜尋:Discord|discord.js|JavaScript|BOT|Node.js
留言共 0 篇留言
前一篇:【discord.js ... 後一篇:【物件懶人包:類別、屬性...