This commit is contained in:
Skylar Grant 2021-09-29 14:57:51 -04:00
parent 583f70e7b7
commit 0f03a53c8f
3 changed files with 28 additions and 1 deletions

26
_clear-commands.js Normal file
View File

@ -0,0 +1,26 @@
// dotenv for handling environment variables
const dotenv = require('dotenv');
dotenv.config();
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { guildId, clientId } = require('./config.json');
const token = process.env.TOKEN;
const rest = new REST({ version: '9' }).setToken(token);
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(
Routes.applicationGuildCommands(clientId, guildId),
{ body: '' },
);
console.log('Successfully reloaded application (/) commands.');
process.exit();
} catch (error) {
console.error(error);
}
})();

View File

@ -1,5 +1,5 @@
{ {
"isDev": true, "isDev": false,
"clientId": "858181619721175050", "clientId": "858181619721175050",
"guildId": "760701839427108874", "guildId": "760701839427108874",
"devChannelId": "890752931643654144", "devChannelId": "890752931643654144",

View File

@ -26,6 +26,7 @@ const { MessageActionRow, MessageButton } = require('discord.js');
const fn = require('./functions.js'); const fn = require('./functions.js');
const config = require('./config.json'); const config = require('./config.json');
const strings = require('./strings.json'); const strings = require('./strings.json');
config.isDev = process.env.isDev;
client.once('ready', () => { client.once('ready', () => {
fn.collections.slashCommands(client); fn.collections.slashCommands(client);