shaitan
shaitan
DIAdiscord.js - Imagine an app
Created by shaitan on 8/8/2024 in #djs-questions
Supported impersonationsold version
As the title suggests, the most supported I'm curious which version is the older one. Is there a separate way to check?
5 replies
DIAdiscord.js - Imagine an app
Created by shaitan on 7/3/2024 in #djs-questions
what is that
No description
2 replies
DIAdiscord.js - Imagine an app
Created by shaitan on 6/29/2024 in #djs-questions
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?
12 replies