I have a snippet of code here
const filter2 = (reaction, user) => {
return reaction.emoji.name === '👎' && user.id === message.author.id;
};
const collector = confirmedMessage.createReactionCollector({filter2, time: 50000});
collector.on('collect', (reaction, user) => {
console.log("PLEASE");
});
The collector will trigger regardless of whether I react to thumbs up or thumbs down. May I know why is it happening? Thanks!
It's because you don't use the filter option. When you simply pass an object like { filter2 }, you're actually saying { filter2: filter2 }, so there is no filter key, just filter2.
Try to change your options like this:
createReactionCollector({ filter: filter2, time: 50000 })
OR rename const filter2 = to const filter = .