Discord limits an app to 100 global slash commands. Subcommands and subcommand groups do not count toward it. My bot, Akiko, was sitting at exactly 100 when this happened. i've folded a few more commands into groups since, so she's at 95 now.
I learned where the wall is the hard way. I added a /settings command, the total became 101, and a test failed with expected 101 to be less than or equal to 100. In production the same mistake shows up as Discord error code 30032 when you deploy your commands.
The most useful thing in the repo is a boring test
There is a test that builds the real list of commands that would be deployed globally and asserts the count is at most 100. Without it you find out at deploy time, on the live bot. The test's own docstring also lists the escape routes in order, and says to never loosen the bound.
The escape routes
- Fold the command into an existing one as a subcommand group.
/report_setupbecame/report setup. - Make it prefix-only, so it only works with the text prefix.
- Make it developer-only. Those deploy to a separate control guild instead of globally, and that scope had plenty of room. Global is the binding constraint.
The scope rules are simple: global means visible, not prefix-only and not developer-only.
The permission trap
Discord ignores default_permissions on subcommands. Permissions are set on the top-level command. So when I folded /report_setup (admin only) into /report (used by ordinary members to file reports), I could not require Manage Server on the setup subcommand alone. Putting the stricter permission on the whole command would have locked ordinary members out of /report user.
The check for that one subcommand has to live in the command body.
What I would do differently
- Count your commands in a test, not in your head.
- Design command names as groups from day one. Every new top-level name spends a scarce slot.
- Never assume a permission set on a subcommand is enforced. Check it in code.
I build Akiko, a Discord bot with AI chat that remembers you, plus economy, music, moderation and a web dashboard. Free to add: https://i.hep.gg/akiko
Top comments (0)