delete all commands
async ResetCommands(guildId) {
var guild = this.Client.guilds.cache.get(guildId);
try {
var commands = await guild.commands.fetch();
if (commands.size == 0) return;
for (const command of commands.values()) {
await guild.commands.delete(command.id);
console.log(`Deleted command in guild ${guild.name}: ${command.name}`);
}
} catch (err) {
console.log(err);
}
// this.Rest.put(Routes.applicationCommands(this.Client.user.id), { body: [] });
} async ResetCommands(guildId) {
var guild = this.Client.guilds.cache.get(guildId);
try {
var commands = await guild.commands.fetch();
if (commands.size == 0) return;
for (const command of commands.values()) {
await guild.commands.delete(command.id);
console.log(`Deleted command in guild ${guild.name}: ${command.name}`);
}
} catch (err) {
console.log(err);
}
// this.Rest.put(Routes.applicationCommands(this.Client.user.id), { body: [] });
}I'm trying to get a command, but the commands keep returning 0.
Maybe I missed something?