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

103
Views
Discord.js Emoji Collector

i have litle problem when i using collector i tried test with logging actions. Then where is problem when i remove/delete reaction from message its doesnt react i must add reaction first time and that removing/deleting reaction detect works after setting first time reaction but previously reaction doesnt works.

const collector = msg.createReactionCollector({ dispose: true });
collector.on('collect', (reaction, user) => {
   console.log("Collect");
});
collector.on('remove', (reaction, user) => {
   console.log("remove");
});
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

If I understood your question correctly, what's happening here is that the message in which the reactions are being added/removed is not cached by the bot on boot, and it is only cached after the first reaction gets added or removed from it, this is why the second action is detected but the first one isn't.

One away to solve this would be to cache the message on startup by fetching it using <TextChannel>.messages.fetch(<MESSAGE_ID>).

about 4 years ago · Juan Pablo Isaza Report

0

I find way how fix this

msg.createReactionCollector({ dispose: true });

client.on('messageReactionAdd', (reaction, user) =>
{
    console.log("ReactionAdded");
});

client.on('messageReactionRemove', (reaction, user) =>
{
    console.log("ReactionAdded");
});
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!