From 0ee06bb51d4a106acb3846c9e993e8873c49a1c9 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 11 Sep 2023 17:34:32 -0700 Subject: [PATCH] Revert Signal Handler Revert the signal handler back to the previous version, await does not work well in this block. --- bot.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) mode change 100755 => 100644 bot.js diff --git a/bot.js b/bot.js old mode 100755 new mode 100644 index 5e33117..2e058b3 --- a/bot.js +++ b/bot.js @@ -12,13 +12,10 @@ const client = new Client( { intents: [GatewayIntentBits.Guilds, GatewayIntentBi // Define Sigtrap Callback for clean shutdowns function signalExit(signal) { console.log(`\tCaught ${signal}`); - // Signal via discord that we are closing - client.channels.fetch("860393205401255936") - .then(papi => papi.send('bye bye papi') ) - // then disconnect - .then( client.destroy() - // and when that is done finally exit - .then( process.exit(0) ) ); + // Close the client cleanly + client.destroy(); + // And exit cleanly + process.exit(0); } // Subscribe to a few signal events process.on('SIGINT', signalExit); // For Ctrl-C when running in a TTY