mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
Fixed shutdown handling
This commit is contained in:
parent
e3a2fbcc78
commit
c91ce23f66
@ -51,10 +51,8 @@ const startBot = async () => {
|
||||
|
||||
const handleShutdown = (signal) => {
|
||||
console.log(`Received ${signal}. Stopping bot...`);
|
||||
bot.stop(signal).then(() => {
|
||||
console.log('Bot stopped.');
|
||||
bot.stop(signal);
|
||||
process.exit(0);
|
||||
});
|
||||
};
|
||||
|
||||
process.once('SIGINT', () => handleShutdown('SIGINT'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user