Emojis in buttons doesn't work

Code: https://sourceb.in/dCkWGPGOOj Error is that it says it is a invalid emoji, but it literally worked like 2 days ago Error:
DiscordAPIError[50035]: Invalid Form Body
components[0].components[0].emoji.name[BUTTON_COMPONENT_INVALID_EMOJI]: Invalid emoji
components[0].components[1].emoji.name[BUTTON_COMPONENT_INVALID_EMOJI]: Invalid emoji
components[2].components[0].emoji.name[BUTTON_COMPONENT_INVALID_EMOJI]: Invalid emoji
components[2].components[1].emoji.name[BUTTON_COMPONENT_INVALID_EMOJI]: Invalid emoji
at handleErrors (C:\Users\truly\Documents\Die Lehre der Väter\node_modules\@discordjs\rest\dist\index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\truly\Documents\Die Lehre der Väter\node_modules\@discordjs\rest\dist\index.js:1072:23)
at async SequentialHandler.queueRequest (C:\Users\truly\Documents\Die Lehre der Väter\node_modules\@discordjs\rest\dist\index.js:913:14)
at async _REST.request (C:\Users\truly\Documents\Die Lehre der Väter\node_modules\@discordjs\rest\dist\index.js:1218:22)
at async TextChannel.send (C:\Users\truly\Documents\Die Lehre der Väter\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:162:15)
at async Object.execute (C:\Users\truly\Documents\Die Lehre der Väter\src\commands\miscellaneous\suggestion.js:73:29)
at async Object.execute (C:\Users\truly\Documents\Die Lehre der Väter\src\events\interactionCreate.js:33:17) {
requestBody: {
files: [],
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: [Array],
components: [Array],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { components: [Object] }
},
code: 50035,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1163838734307971214/messages'
}
DiscordAPIError[50035]: Invalid Form Body
components[0].components[0].emoji.name[BUTTON_COMPONENT_INVALID_EMOJI]: Invalid emoji
components[0].components[1].emoji.name[BUTTON_COMPONENT_INVALID_EMOJI]: Invalid emoji
components[2].components[0].emoji.name[BUTTON_COMPONENT_INVALID_EMOJI]: Invalid emoji
components[2].components[1].emoji.name[BUTTON_COMPONENT_INVALID_EMOJI]: Invalid emoji
at handleErrors (C:\Users\truly\Documents\Die Lehre der Väter\node_modules\@discordjs\rest\dist\index.js:687:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\truly\Documents\Die Lehre der Väter\node_modules\@discordjs\rest\dist\index.js:1072:23)
at async SequentialHandler.queueRequest (C:\Users\truly\Documents\Die Lehre der Väter\node_modules\@discordjs\rest\dist\index.js:913:14)
at async _REST.request (C:\Users\truly\Documents\Die Lehre der Väter\node_modules\@discordjs\rest\dist\index.js:1218:22)
at async TextChannel.send (C:\Users\truly\Documents\Die Lehre der Väter\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:162:15)
at async Object.execute (C:\Users\truly\Documents\Die Lehre der Väter\src\commands\miscellaneous\suggestion.js:73:29)
at async Object.execute (C:\Users\truly\Documents\Die Lehre der Väter\src\events\interactionCreate.js:33:17) {
requestBody: {
files: [],
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: [Array],
components: [Array],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { components: [Object] }
},
code: 50035,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1163838734307971214/messages'
}
2 Replies
d.js toolkit
d.js toolkit14mo 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!
duck
duck14mo ago
upvote
it's doubtful that this previously worked given that the name of the emoji is just upvote are you sure you weren't previously passing the string directly to setEmoji? if you import ButtonBuilder from discord.js rather than @discordjs/builders, it would resolve upvote to the expected data
Want results from more Discord servers?
Add your server