What happened?
This snippet of code causes the above error:
case 'MessageReact': {
const message = client.messages.getOrPartial(event.id);
if (message) {
const reactions = message.reactions;
const set = reactions.get(event.emoji_id);
... when a messageReactionAdd event listener exists:
// ...
this.options.client.on('messageReactionAdd', this.listener);
// ...
This code was used to trigger the error:
await msg.clearReactions();
await msg.react(encodeURIComponent('❌'));
Explanation: The event tries to get which reaction was added (?), but, since clearReactions ran, message.reactions is {}, causing the reactions.get is not a function error, since reactions is not a Map anymore.
My temporary fix:
case 'MessageReact': {
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);
What happened?
This snippet of code causes the above error:
... when a
messageReactionAddevent listener exists:This code was used to trigger the error:
Explanation: The event tries to get which reaction was added (?), but, since
clearReactionsran,message.reactionsis{}, causing thereactions.get is not a functionerror, sincereactionsis not aMapanymore.My temporary fix: