Osinted
Osinted
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
Have a good one.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
But thank you for an opinion I did not request, I do hope you recieve some type of help for your attitude.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
I'm asking for a simple answer.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
When I have no clue who you are, nor do I care to.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
Alright, now you're really sound off. You're claiming I "lied" to you.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
Especially, when I'm asking for assistance on a simple issue.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
Considering I haven't touched js in 2+ years, I don't think I needed you to go ahead and disrespect and act like youre entitled.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
I don't think I needed a rude ass opinion, but thank you.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
I already figured it out.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
No description
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
lemme check
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
I think it worked.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
const { REST, Routes, SlashCommandBuilder } = require('discord.js');
const { clientId, guildId, token } = require('./config.json');

module.exports = {
data: new SlashCommandBuilder()
.setName('delete-commands')
.setDescription('Delete all slash commands'),
async execute(interaction) {
const rest = new REST().setToken(token);

try {
await rest.get(Routes.applicationGuildCommands(clientId, guildId));
const commands = await rest.get(Routes.applicationGuildCommands(clientId, guildId));

if (commands.length === 0) {
await interaction.reply('No commands to delete!');
return;
}

await Promise.all(commands.map(command => rest.delete(`${Routes.applicationGuildCommands(clientId, guildId)}/${command.id}`)));
await interaction.reply(`Deleted ${commands.length} slash commands!`);
} catch (error) {
console.error(error);
await interaction.reply('Error deleting commands!');
}
},
};
const { REST, Routes, SlashCommandBuilder } = require('discord.js');
const { clientId, guildId, token } = require('./config.json');

module.exports = {
data: new SlashCommandBuilder()
.setName('delete-commands')
.setDescription('Delete all slash commands'),
async execute(interaction) {
const rest = new REST().setToken(token);

try {
await rest.get(Routes.applicationGuildCommands(clientId, guildId));
const commands = await rest.get(Routes.applicationGuildCommands(clientId, guildId));

if (commands.length === 0) {
await interaction.reply('No commands to delete!');
return;
}

await Promise.all(commands.map(command => rest.delete(`${Routes.applicationGuildCommands(clientId, guildId)}/${command.id}`)));
await interaction.reply(`Deleted ${commands.length} slash commands!`);
} catch (error) {
console.error(error);
await interaction.reply('Error deleting commands!');
}
},
};
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
I just made this.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
Yeah, i did.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
that's weird, I swear I put them.
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
:Bruh:
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
ReferenceError: Cannot access 'commands' before initialization
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
I just throw that in my deploy-commands?
23 replies
DIAdiscord.js - Imagine an app
Created by Osinted on 7/6/2024 in #djs-questions
Delete all Slash Commands
Anyone have an idea?
23 replies