DiscordAPIError[50035]: Invalid Form Body

After yesterdays scheduled restart, the following error appears after a button interaction reply. This code worked up until now.
DiscordAPIError[50035]: Invalid Form Body
data.components[1].components[0].options[1].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
...
at handleErrors (**/bot/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (**/bot/node_modules/@discordjs/rest/dist/index.js:826:23)
at async _REST.request (**/bot/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async ButtonInteraction.reply(**/bot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:111:5)
at async VCManager.vcm_create(**/bot/dist/channelmanager/channel.js:239:9)
DiscordAPIError[50035]: Invalid Form Body
data.components[1].components[0].options[1].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
...
at handleErrors (**/bot/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (**/bot/node_modules/@discordjs/rest/dist/index.js:826:23)
at async _REST.request (**/bot/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async ButtonInteraction.reply(**/bot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:111:5)
at async VCManager.vcm_create(**/bot/dist/channelmanager/channel.js:239:9)
new StringSelectMenuOptionBuilder({
label: 'Public',
value: 'public',
emoji: '🔓',
default: false,
})
new StringSelectMenuOptionBuilder({
label: 'Public',
value: 'public',
emoji: '🔓',
default: false,
})
After commenting out the emoji property emoji: '🔓', everything worked fine again. Is there anything I can do to fix this?
14 Replies
d.js toolkit
d.js toolkit5mo ago
- 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 OP
Danial
Danial5mo ago
How are you importing StringSelectMenuOptionBuilder?
Xarot
Xarot5mo ago
import { StringSelectMenuOptionBuilder } from "discord.js";
import { StringSelectMenuOptionBuilder } from "discord.js";
Like I said, everything was still working yesterday. I guess something new with DiscordAPI?
Danial
Danial5mo ago
Can you use toJSON() on the select menu and then log it and see what it shows?
treble/luna
treble/luna5mo ago
isnt emoji supposed to be an object
d.js docs
d.js docs5mo ago
dtypes v10: APIMessageComponentEmoji read more
Danial
Danial5mo ago
It resolves it into an object if it's string
Xarot
Xarot5mo ago
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
Danial
Danial5mo ago
The builder converts it, the API doesn't take string, only an object
Xarot
Xarot5mo ago
So there was something wrong with the builder?
Danial
Danial5mo ago
Nope, the code looks fine, it always supposed to return an object or null Very weird
Xarot
Xarot5mo ago
Maybe you can figure out where the issue originated from. This is the whole log:
data.components[1].components[0].options[1].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[2].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[3].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[4].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[5].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[6].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[7].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[8].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[9].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[10].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[11].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[12].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[13].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[14].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[15].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[16].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[17].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[18].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[19].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[20].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[21].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[22].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[23].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[24].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
Stracktrace:

And then it repeats again
data.components[1].components[0].options[1].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[2].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[3].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[4].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[5].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[6].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[7].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[8].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[9].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[10].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[11].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[12].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[13].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[14].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[15].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[16].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[17].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[18].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[19].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[20].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[21].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[22].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[23].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
data.components[1].components[0].options[24].emoji[MODEL_TYPE_CONVERT]: Expected an object/dictionary.
Stracktrace:

And then it repeats again
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.
Danial
Danial5mo ago
Looks fine Like you passed in an empty string for one of them?
Xarot
Xarot5mo ago
yeah like this: emoji: '', and it did work up until now 😄
Want results from more Discord servers?
Add your server
More Posts
Issue with guild.roles.create()I am trying to create a role with discord.js, using guild.roles.create(). The promise this function Interaction already deferred.https://github.com/KiraKenjiro/bot The bot at the moment works almost *perfectly*. qj's been a saviHow to add support for private slash commandsNot a big Discord user so lots of common stuff I don't know. But I've made a bot for use just in oneSelecting the same Slash Command option multiple timesHello. Currently learning the basics of Discord.js, I was wondering if it supported selecting the saDiscord Error Code 10015 when using a collector to handle button eventsHello! I am working on a bot Im on the development team with and I dont know how to fix this issue. How would I send an interaction user a message DM?Currently trying to send a user a DM, I've had a quick scope at the docs and Noticed `createDM`, NoDiscord TTS botHi there I am trying to create a discord bot where it would join a vc that I am in and when I use !tHow to retrieve original command interaction options from select menu interaction?Hi people, I am trying to figure out if it's possible to retrieve CommandInteraction options from a When I interact, whether creating ephemeral messages or editing (editReply) it doesn't workWhen I interact with a dropdown or button, whether to edit or create a new ephemera message, it doesSend audio from one channel to another one in another guildHi, I'm currently making a discord bot about game events utilities, and I had an idea. Basically I w