Merge branch 'master' into fix-33

This commit is contained in:
Christer Warén
2021-09-06 22:49:37 +03:00
26 changed files with 243 additions and 97 deletions

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 = {
name: 'SIGINT',
async execute(client) {
execute(client) {
client.user.setStatus('dnd');
console.log("\n");
client.funcs.logger("Bot", "Closing");
console.log("\n");
client.funcs.saveRadios(client);
setTimeout(async function () {
let message = {};
if (!client.stations) return process.exit();
await client.funcs.saveRadios(client);
await process.exit();
}, 5000);
setInterval(() => {
if(client.radio.size == 0){
process.exit();
}
}, 500);
}
}

View File

@ -1,6 +1,6 @@
module.exports = {
name: 'SIGTERM',
async execute(client) {
execute(client) {
process.emit('SIGINT');
}
}

View File

@ -0,0 +1,7 @@
module.exports = {
name: 'uncaughtException',
execute(client, error) {
console.log(error.stack);
process.emit('SIGINT');
}
}