Send a commands
array of your own guild-specific slash commands on GUILD_CREATE
#3343
Unanswered
cakedan
asked this question in
API Feature Requests & Ideas
Replies: 1 comment
-
Why not make it a feature to restrict specific global slash commands to an array of guilds instead of just allowing for bulk commands arrays of guild-specific slash commands? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
After designing my library's slash commands, I found that supporting guild-specific slash commands is coming with a huge headache. The only way to see if a guild has any of your slash commands is to fetch it from HTTP. Theres no number sent with
GUILD_CREATE
payloads to even compare that too. This isn't a huge issue if lets say you only want a few servers to have guild-specific commands, but passing that is a ratelimiting nightmare.Currently, for global commands, I fetch the commands on startup and compare each one to the local commands on the bot, if any of them differ, then I call
bulk-overwrite-application-commands
with the new payload (while also sending in the id of any top-level commands that matched so it wouldn't "create" a new command). This is possible with a few guild ids, like one test server, but at scale it becomes a nightmare to deal with.Why This is Needed
Let us say you have a bot in around 500k servers, with 50k of them being "premium". You'd want those premium servers to have premium slash commands, but that would be 50k fetches, comparisons, and 50k overwrites if any differ. Sending in the guild's slash commands means we'd be able to compare on
GUILD_CREATE
and send in the overwrite then. It's still a headache but it is not as terrible as right now.Alternatives Considered
Maybe just a count of your own bot's commands on the guild, something like
application_commands_count
but for your own. It'll at least allow for some sort of comparison for now..Additional Details
Beta Was this translation helpful? Give feedback.
All reactions