-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: MessageReact event crashes with: TypeError: reactions.get is not a function #78
Labels
bug
Something isn't working
Comments
In case it helps, this happened on The same issue seems to occur on the "MessageUnreact" event: case 'MessageUnreact': {
const message = client.messages.getOrPartial(event.id);
if (message) {
const set = message.reactions.get(event.emoji_id); where "message.reactions" is edit: fixed it with: case 'MessageUnreact': {
const message = client.messages.getOrPartial(event.id);
if (message) {
let reactions = message.reactions;
if (!(reactions instanceof Map)) reactions = new Map();
const set = reactions.get(event.emoji_id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
This snippet of code causes the above error:
... when a
messageReactionAdd
event listener exists:This code was used to trigger the error:
Explanation: The event tries to get which reaction was added (?), but, since
clearReactions
ran,message.reactions
is{}
, causing thereactions.get is not a function
error, sincereactions
is not aMap
anymore.My temporary fix:
The text was updated successfully, but these errors were encountered: