Clear guild commands
This commit is contained in:
parent
2989f40e3b
commit
1c41dff700
11
index.js
11
index.js
|
@ -69,6 +69,17 @@ client.on('ready', async () => {
|
|||
log.error(error)
|
||||
});
|
||||
|
||||
// Clear guild commands
|
||||
log.info("Clearing guild commands...")
|
||||
const guilds = client.guilds.cache.map(guild => guild.id);
|
||||
for (const guild of guilds) {
|
||||
rest.put(Discord.Routes.applicationGuildCommands(client.user.id, guild), { body: [] }).then(() => {
|
||||
log.success(`Cleared commands for guild ${guild}`)
|
||||
}).catch((error) => {
|
||||
log.error(error)
|
||||
});
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
log.error(error)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue