all repos — simple-discord-music-bot @ f5ac8b7e1de04b34091806153194cabdf9c24c6e

A Discord bot making use of discord.js and play-yt.

tools/delete-commands.js (view raw)

 1const path = require('node:path');
 2const { Routes } = require('discord.js');
 3const { REST } = require('@discordjs/rest');
 4const { applicationId, token } = require(path.join(process.cwd(), 'config.json'));
 5
 6if (!(applicationId && token))
 7    throw 'Check your config.json!';
 8
 9const rest = new REST({ version: '10' }).setToken(token);
10rest.put(Routes.applicationCommands(applicationId), { body: [] })
11    .then(() => console.log('Successfully deleted all application commands.'))
12    .catch(console.error);