Detect bot removed reaction and return in messageReactionRemove
Node: 20.8.0
discordjs: 14.14.1
I think i'm losing my mind. I swear at one point the following was true:
removed a users reaction. This is still true.
But then i used to be able to detect in the Events.MessageReactionRemove if the bot was the one who removed the reaction and return early. I must be going crazy though because nothing works.
The user is always the user who reaction initially, not the one removing. Maybe this has always been the case and there is no solution to my problem. I just need to know one way or another if it's possible or ever was possible.
5 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!this has always been the case
Ah okay thank you. Is there an elegant solution to accomplishing my goal that's used by the community? I can't be the first one to want to solve this problem
I dont think so as there's no audit log event afaik
my inelegant solution is a global variable on the server...seems like the only way
here's what i came up with
In case anyone comes across this thread:
That code stores a reaction removal from a bot keyed by the message ID and saves the originalUserID who's reaction we removed and the reaction name.
Then we can lookup on reaction removal if the bot removed a reaction for that message, and then check that the User param (which SHOULD be the bot but is the user instead) matches the user id in that bot removal Record. If it does, it was actually removed by the bot and we can return
You're right, I was wrong to say what that parameter should do, it's working as expected for sure. It would be nice for that to be exposed though, somehow