You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aBot/destroy-commands.js

22 lines
773 B
JavaScript

const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { clientId, guildId, token } = require('./config.json');
const rest = new REST({ version: '9' }).setToken(token);
// Need to get the commandID from the server for these
// Developer Mode | Server Settings -> Integrations -> Bots and Apps
// To delete ALL, replace command ID w/ { body: [] }
// for guild-based commands
rest.delete(Routes.applicationGuildCommand(clientId, guildId, { body: [] }))
.then(() => console.log('Successfully deleted guild command'))
.catch(console.error);
// for global commands
rest.delete(Routes.applicationCommand(clientId, { body: [] }))
.then(() => console.log('Successfully deleted application command'))
.catch(console.error);