DiscordAPIError[50035]: Invalid Form Body
After yesterdays scheduled restart, the following error appears after a button interaction reply. This code worked up until now.
After commenting out the emoji property
emoji: '🔓'
, everything worked fine again. Is there anything I can do to fix this?14 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPHow are you importing StringSelectMenuOptionBuilder?
Like I said, everything was still working yesterday. I guess something new with DiscordAPI?
Can you use toJSON() on the select menu and then log it and see what it shows?
isnt emoji supposed to be an object
It resolves it into an object if it's string
Yeah, thats why I did it that way.
Yes, give me a sec.
I am losing my mind. It works now. Seems like it was an issue with the DiscordAPI not converting it right.
So it had nothing to do with my code
The builder converts it, the API doesn't take string, only an object
So there was something wrong with the builder?
Nope, the code looks fine, it always supposed to return an object or null
Very weird
Maybe you can figure out where the issue originated from. This is the whole log:
So how can the result be different, if my local files are the exact same as before.
This is how it looks like when I log it to JSON:
emoji: { animated: false, name: ':unlock:', id: undefined }
Note that ':unlock:'
looks like this 🔓 inside the log. Discord just edited my message
Ok, so to wrap this up:
Idk why but one StringSelectMenuOptionBuilder had an empty emoji string, which (NOW!) can not be converted to an object anymore.
Anyways, thanks to you both @Danial 🐝 @arcticwolvinny ❄ 🌈 for helping me out with this one.Looks fine
Like you passed in an empty string for one of them?
yeah like this: emoji: '',
and it did work up until now 😄