How to reload a command or multiple slash commands and get their ids
Does anyone know how to reload multiple commands or a slash command and also get them their ids?
Solution:Jump to solution
you can but you can also use https://discord.js.org/docs/packages/discord.js/14.16.2/ApplicationCommandManager:Class#delete
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
6 Replies
Use the DiscordJS cache to get the ids: https://discord.js.org/docs/packages/discord.js/14.16.2/ClientApplication:Class#commands
I'm not sure what you mean by reload. Sapphire will automatically load and reload commands when you restart the application.
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Did I mean that there is a way to remove the old commands?
Idk... Did you?
I can't use this? https://sapphirejs.dev/docs/Guide/commands/application-commands/application-command-registry/advanced/setting-global-behavior-when-not-identical, I need it to remove two commands that no longer exist in the code
Solution
you can but you can also use https://discord.js.org/docs/packages/discord.js/14.16.2/ApplicationCommandManager:Class#delete
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Thanks, I needed this