I'm quite new to discord.js, and I want the bot to send a message when it goes offline, how can I do that? I am using version 11.5.1.
You can't send message if disconnection is unexpected, however you can make it send message if you're the one who disconnects the bot.
channel.send('Disconnecting...').then(msg => client.destroy());
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.