"Maximum number of application commands reached" but hitting the API returns an empty array?
I realized I was setting up global commands when developing my bot and have recently switched to using guild commands instead. However, when I run my bot locally I get an error message along these lines:
Failed to overwrite global application commands DiscordAPIError[30032]: Maximum number of application commands reached (5).
So I went through the process of deleting all the global application commands by hitting /applications/{application.id}/commands
and copying down the ids of each command, then hitting /applications/{application.id}/commands/{command.id}
.
However, I'm still seeing the "Failed to overwrite global application commands" message when starting my bot. I double-checked /applications/{application.id}/commands
and it's returning an empty array so I don't have any global application commands according to the API, and I know that I don't have 5 context menu commands (I counted them, it's 3 actually) so I'm not sure what exactly it's complaining about? I've attached guildIds
options to each of my commands so I feel like that can't be the issue? I feel like I'm missing something but I'm not sure what it could be.27 Replies
do you not get logs of which command is erroring?
Or are you using BulkOverwrite?
it appears to be happening on startup with BulktOverwrite
Intriguing
oh GLOBAL is erroring
INTRIGUING
yeah, I'm not sure why? I can definitely tell I don't have any global application commands...the API even says so!
can you set your logLevel to debug
OH SHIT
hmm
I can post the log messages, just give me a minute or two 🙂
mhm
I'm trying to see if maybe I fucked something up
wasn't sure if it was better to post that in a pastebin or something but says it's at "22 commands" but I don't see how that could be the case?
Hmm, 10 commands but 22 app commands
Check your registry calls
I have 3 calls to
registerContextMenuCommand
and 6 calls to registerApplicationCommands
6 calls to what
ah, let me clarify, I don't see any duplicate calls to
registerChatInputCommand
or registerContextMenuCommand
- I have 6 total commands in the bot so faryou have 10 well
10 loaded commands
right, but I thought the limit for slash commands was 100? Or am I misremembering?
that it is
Is this a public bot?
as in
OSS
hmm...let me check one thing really quick
I also want you to double confirm you saying
registerApplicationCommands
was wrong yeah, I mistyped that, there's one call to
registerApplicationCommands
in each command file 😅theres 1
WHAT
call or reference
you shouldn't call that method yourself if thats what you're saying rn
oh no, I'm not calling it myself; this is what I get for checking my phone after a nap. I mean to say that there's one registerApplicationCommands reference in each file.
o k
thats a relief
uh
Circling back, is the code open source?
Because your error shouldn't happen
I do, I just wanna try rebuilding my typescript - I had a command file that I completely commented out and maybe by some weird happenstance, that's causing issues.
but if that doesn't fix it, I'll link you to the repo
try a clean build
rm -rf dist
build
ha, yep, that fixed it
I'm curious as to why commenting out a command would cause that error though.
its not impossible that the comment out wasn't the issue, but the built code had lingering commands that you might've deleted that never got rebuilt
and welp
they did things
fair enough either way, thanks for the help, I appreciate it!
any time
:3