Fixed shutdown handling

This commit is contained in:
A Bunch of Computer Nerds 2024-12-08 20:49:46 -03:00
parent e3a2fbcc78
commit c91ce23f66

View File

@ -51,10 +51,8 @@ const startBot = async () => {
const handleShutdown = (signal) => { const handleShutdown = (signal) => {
console.log(`Received ${signal}. Stopping bot...`); console.log(`Received ${signal}. Stopping bot...`);
bot.stop(signal).then(() => { bot.stop(signal);
console.log('Bot stopped.'); process.exit(0);
process.exit(0);
});
}; };
process.once('SIGINT', () => handleShutdown('SIGINT')); process.once('SIGINT', () => handleShutdown('SIGINT'));