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);