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
|
// Define Sigtrap Callback for clean shutdowns
|
||||||
function signalExit(signal) {
|
function signalExit(signal) {
|
||||||
console.log(`\tCaught ${signal}`);
|
console.log(`\tCaught ${signal}`);
|
||||||
// Signal via discord that we are closing
|
// Close the client cleanly
|
||||||
client.channels.fetch("860393205401255936")
|
client.destroy();
|
||||||
.then(papi => papi.send('bye bye papi') )
|
// And exit cleanly
|
||||||
// then disconnect
|
process.exit(0);
|
||||||
.then( client.destroy()
|
|
||||||
// and when that is done finally exit
|
|
||||||
.then( process.exit(0) ) );
|
|
||||||
}
|
}
|
||||||
// Subscribe to a few signal events
|
// Subscribe to a few signal events
|
||||||
process.on('SIGINT', signalExit); // For Ctrl-C when running in a TTY
|
process.on('SIGINT', signalExit); // For Ctrl-C when running in a TTY
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user