-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremove.js
27 lines (22 loc) · 838 Bytes
/
remove.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
(async () => {
try {
console.log('Début de la suppression des commandes slash.');
// Récupérer toutes les commandes slash
const commands = await rest.get(
Routes.applicationGuildCommands(clientId, guildId),
);
// Supprimer toutes les commandes slash
for (const command of commands) {
await rest.delete(
Routes.applicationGuildCommand(clientId, guildId, command.id),
);
}
console.log('Suppression des commandes slash terminée.');
} catch (error) {
console.error(error);
}
})();