MartialAssault
DIAdiscord.js - Imagine an app
•Created by MartialAssault on 5/8/2025 in #djs-questions
Registering multiple commands for many guilds
I am trying to register 7 premium commands only for 1 guild and 25 public commands for all the others (including the premium guild).
I tried 2 approaches -
- Using the GuildApplicationCommandManager Class
- Using REST API
Using the first method, I usually get rate limited, and for my premium server, the 25 public commands are never stored to cache and on every bot reload, only 7 premium commands remain. I switched to this method because I was getting duplicate commands using the
rest.put()
method.
I have included all the necessary files along with the message.
The flow goes as such -
- As soon as the bot is ready, first the 01registerSlashCommands.js
runs followed by 02registerPublicSlashCommands
.
- The utility files help to return local
(in the project files) and the application
(GuildApplicationCommandManager.fetch())
commands.
Should I switch back to the REST approach or is there a way out of this?
Note: Please ignore the return
statement in the 01registerSlashCommands.js
file22 replies