Revert Signal Handler
Revert the signal handler back to the previous version, await does not work well in this block.
This commit is contained in:
parent
b93c4c571b
commit
0ee06bb51d
11
bot.js
Executable file → Normal file
11
bot.js
Executable file → Normal file
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user