我正在尝试:
if(message.content == config.goesOff){
client.channels.fetch(channelId.toString()).then(channel => {
channel.send("The bot is shutting down").then(()=>{server.close()});
});
server.close();
return
}
但是当我使用命令 !fbOff (config.goesOff) 时,它不会发送消息“机器人正在关闭”,它只是运行
Sever.close()
答案 0 :(得分:0)
试试
const channel = await client.channels.fetch(channelId.toString())
await channel.send("The bot is shutting down")
server.close();
确保您的消息事件是异步的 :)