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

135
Views
Bot won't detect its own reaction even when fetching

My discord bot is supposed to remove the last reaction if a user clicks a second reaction. I tried fetching the message, reaction and reaction users. Whatever I do, if my bot was restarted after it reacted, reaction.me is always false. How can I fix this?

This is my current code:

//trying to detect a 2nd user reaction gives expected result
console.log('Reaction.me: ', reaction.me) //always false no matter how many times I click the reaction
if(user.bot) return;
if(reaction.partial) await reaction.fetch().catch(console.log)
if(reaction.message.partial) await reaction.message.fetch().catch(console.log);
await reaction.users.fetch()
await reaction.message.reactions.cache.find(r => r.emoji.name === (reaction.emoji.name === '⬆️') ? '⬇️' : '⬆️').users.fetch()
if(!reaction.me) return; //always returns early here

Note: after further testing, it seems that the client user is found in the cache, but reaction.me remains false. It does fix my problem, but I would like to understand why I have this problem with reaction.me.

about 4 years ago · Juan Pablo Isaza
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!