all repos — simple-discord-music-bot @ 394cdf4f8bb25b2fdc6eb4a21d67aa1b4bff9db8

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