Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
Discordjs my reaction collector is triggering when I don't want it to

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");
      });

enter image description here

The collector will trigger regardless of whether I react to thumbs up or thumbs down. May I know why is it happening? Thanks!

about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

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 = .

about 4 years ago ยท Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!