REST dont make Slash Commands

My guild Slash Commands dont register any more A few days ago, all was still working. But I added a context menu handler to my bot with a similar code what I has taken for my guild Slash Commands.
(async () => {
try {
await rest.put(
GUILD_ID ?
Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID) :
Routes.applicationCommands(CLIENT_ID),
{ body: slashCommands }
);
console.log(chalk.yellow('Slash Commands • Registered'))
} catch (error) {
console.log(error);
}
})();
(async () => {
try {
await rest.put(
GUILD_ID ?
Routes.applicationGuildCommands(CLIENT_ID, GUILD_ID) :
Routes.applicationCommands(CLIENT_ID),
{ body: slashCommands }
);
console.log(chalk.yellow('Slash Commands • Registered'))
} catch (error) {
console.log(error);
}
})();
My problem is, that the context menus are still working after deleting the context menu handler file and the slash commands dont register.
4 Replies
d.js toolkit
d.js toolkit14mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Black_Wither
Black_Wither14mo ago
If it dont excist any results for this rest.put function, I can send what i develop for the context Menu handler *It only works when I register it as public commands, when I make it only for one guild it doesnt work maybe because the context menus was only for one guild too oh okay thanks, but how can I delete the old context menus, because they still working after deleting the handler + file The slash commands are overwritten by the context menus despite the fact that I deleted the files that were created for the context menus Yes the context menu is still replying of some reason that I dont know. Is there a guide post for this? I has taken
client.guilds.cache.forEach(async g => await g.commands.set([]));
client.guilds.cache.forEach(async g => await g.commands.set([]));
in the ready event, and after this, the context menu was deleted yesterday but the guild slash commands still not working
Black_Wither
Black_Wither14mo ago
yes but the slash command handler put the commands while the start again in the bot or not?
Black_Wither
Black_Wither14mo ago
I tried it with another guild id and it works. But of some reason it works only for the one guild not, where I tried the context menu handler? Can I reset it on someway? I tried to kick the bot, but after it, it still not work.
Want results from more Discord servers?
Add your server