Typescript type for Emoji.id
is wrong, or there's a bug somewhere else
#9948
Labels
Emoji.id
is wrong, or there's a bug somewhere else
#9948
Which package is this bug report for?
discord.js
Issue description
I have had a very difficult time reproducing this bug.
Background: I have observed buggy behavior in a starboard component in my bot. Messages can get stuck in a state where the the bot doesn't put them on the starboard despite setting the right reaction counts. Rebooting the bot allows the messages to get onto the starboard.
In order to reproduce I have to leave my bot running for hours while people react to messages.
Through triage I have found that the error is I'm relying on a check
reaction.emoji.id === null
, but somehowreaction.emoji.id
isundefined
instead ofnull
.What I observe when printing
Discord.MessageReaction
objects to the console is the following:Sometime for a ⭐ reaction the emoji looks like the following
Other times I see the following:
This is the
_emoji
field ofDiscord.MessageReaction
, but based on https://github.com/discordjs/discord.js/blob/dbb92e5bc416d4fc3cbe7197baa941a1583d95b5/packages/discord.js/src/structures/MessageReaction.js#L81C1-L93C4 it should match.Code sample
Versions
Note: I have had issues with odd behavior with message reactions going back to 14.8. At that point the reaction counts were buggy.
Issue priority
Medium (should be fixed soon)
Which partials do you have configured?
User, Channel, Message, Reaction
Which gateway intents are you subscribing to?
Guilds, GuildMembers, GuildModeration, GuildEmojisAndStickers, GuildIntegrations, GuildWebhooks, GuildInvites, GuildVoiceStates, GuildMessages, GuildMessageReactions, GuildMessageTyping, DirectMessages, DirectMessageReactions, DirectMessageTyping, MessageContent
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: