Trying to detect emojis added to messages
I am attempting to detect when emojis are added to messages and do different things based on the emoji however currently it isn't doing anything. I found a thing mentioning doing it this way so I tried it, I also looked into event handling and tried putting it into its own file, below, and that didn't work either. Neither of them give errors they simply don't print anything.
inside of index.js:events/messageReactionAdd.js:
12 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 OPThat’s not a valid format for Emoji.identifier
You should just check the emoji.id to the custom emoji id that ur checking for
If that were the problem it would still be either printing something (even if just undefined) or giving an error, but it isn't doing either.
I will still make that change, but right now it isn't even entering execute or client.on(Events.MessageReactionAdd
Is the reaction occurring in a guild?
Yeah, and the bot can see messages in the guild
Did you enable the guild message reactions intent?
I believe so, how can I double check?
Nevermind, I found it, I had thought GuildMessages and MessageContent together would include it.
unfortunately however adding the intent doesn't fix the issue
Was the message sent before the bot became ready?
Ah, yeah. That was the issue. Does there happen to be any way around that issue?
Enable the message partial
Thank you, that solved it. ^v^