diff --git a/src/client/events/SIGINT.js b/src/client/events/SIGINT.js index dc0bf65..e7cbdbf 100644 --- a/src/client/events/SIGINT.js +++ b/src/client/events/SIGINT.js @@ -1,4 +1,7 @@ import Discord from "discord.js"; +const { REST } = require('@discordjs/rest'); +const { Routes } = require('discord-api-types/v9'); +const { token, version } = require('../config.js'); module.exports = { name: 'SIGINT', @@ -33,6 +36,26 @@ module.exports = { client.user.setStatus('dnd'); + const rest = new REST({ version: '9' }).setToken(token); + if(version.includes("-dev")){ + await rest.put( + Routes.applicationCommands(client.user.id), + { body: [] }, + ); + + let guilds = await client.guilds.fetch(); + guilds.forEach(async guild => { + try { + await rest.put( + Routes.applicationGuildCommands(client.user.id, guild.id), + { body: [] }, + ); + } catch (DiscordAPIError) { + + } + }); + } + setInterval(() => { if(radio.done){ process.exit();