How to add slash command dynamically? #2467
-
Suppose I want to generate a slash command from user input. I have made a function factory to return a function like so: Minimum Reproducible Code
I have tried to do this and there are no errors. However, adding the command using this method simply has no effect. What do I need to do to add a command manually? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You will need to use Bot.sync_commands passing the list of new commands. It should be noted that there is a ratelimit of 200 command registers per day. It is also possible that you want to be using guild commands. This will allow only people in the guild to use the new command (so that it can be custom per guild) and has a separate ratelimit of 200 per guild per day. If you would like you can also join our support Discord server |
Beta Was this translation helpful? Give feedback.
You will need to use Bot.sync_commands passing the list of new commands. It should be noted that there is a ratelimit of 200 command registers per day. It is also possible that you want to be using guild commands. This will allow only people in the guild to use the new command (so that it can be custom per guild) and has a separate ratelimit of 200 per guild per day.
If you would like you can also join our support Discord server