Bot staying online when code isn’t running

In Discord.py, when I stop the code from running the bot account instantly goes offline. Why does it take a few minutes for Discord.js to do the same?
3 Replies
d.js toolkit
d.js toolkitβ€’12mo ago
β€’ What's your exact discord.js npm list discord.js and node node -v version? β€’ Post the full error stack trace, not just the top part! β€’ Show your code! β€’ Explain what exactly your issue is. β€’ Not a discord.js issue? Check out #useful-servers.
Syjalo
Syjaloβ€’12mo ago
You should destroy client manually
const signalListener = () => {
client.destroy();
process.exit()
}
process.on('SIGINT', signalListener);
process.on('SIGTERM', signalListener);
const signalListener = () => {
client.destroy();
process.exit()
}
process.on('SIGINT', signalListener);
process.on('SIGTERM', signalListener);