Updated SIGINT event

This commit is contained in:
Christer Warén 2021-09-06 21:44:59 +03:00
parent 884233a938
commit 4edfe6848c

View File

@ -1,23 +1,18 @@
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { token, version } = require('../../config.js');
module.exports = { module.exports = {
name: 'SIGINT', name: 'SIGINT',
async execute(client) { execute(client) {
client.user.setStatus('dnd'); client.user.setStatus('dnd');
console.log("\n"); console.log("\n");
client.funcs.logger("Bot", "Closing"); client.funcs.logger("Bot", "Closing");
console.log("\n"); console.log("\n");
client.funcs.saveRadios(client);
setTimeout(async function () { setInterval(() => {
let message = {}; if(client.radio.size == 0){
process.exit();
if (!client.stations) return process.exit(); }
}, 500);
await client.funcs.saveRadios(client);
await process.exit();
}, 5000);
} }
} }