all repos — simple-discord-music-bot @ 858558392fd3953294b6c45ca9951af53a9f1e27

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