all repos — simple-discord-music-bot @ 8f1693b44bb58af48d564493d00baf74f37a27b8

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