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

128
Views
Why bot doesn't fire messageReactionAdd event when the message was sent before the bot was online

This is my event to check user add react:

const client = require("../index");

client.on('messageReactionAdd', async (reaction, user) => {
    if (user.bot) return;
    console.log(reaction.emoji.name);
});

It's working, but when the bot restarts, it can't fetch any message sent before?

Why and how to fix it?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

If you don't enable partial structures, your code only works on cached messages, ones posted after the bot is connected. Reacting on older messages won't fire the messageReactionAdd event. If you also want to listen to reactions on old messages you need to enable partial structures for MESSAGE, CHANNEL and REACTION when instantiating your client, like this:

const client = new Discord.Client({
  intents: [/* YOUR INTENTS */],
  partials: ['MESSAGE', 'CHANNEL', 'REACTION'],
});
about 4 years ago · Juan Pablo Isaza Report

0

You need partials:

const client = new Client({
    intents: ‘’, // your intents here
    partials: ['CHANNEL', 'GUILD_MEMBER', 'GUILD_SCHEDULED_EVENT', 'MESSAGE', 'REACTION', 'USER'],
});
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!