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

86
Views
messageReactionAdd isn't firing despite proper setup Discord.js

Entire file below. I've been trying for an ungodly amount of time to get a reaction roles command working. Currently using MongoDB and everything is setup properly no errors my schema has worked properly as well there are no issues. Despite everything working I cannot get my event to fire at all with multiple revisions. Any help would be phenomenal on this one as I am too new to all of this to figure it out for myself...

const Schema = require('../reactions');
const Discord = require('discord.js');
const { client, intents } = require('..')

module.exports = {
    name: 'messageReactionAdd',
    run: async (reaction, message, user) => {
    
        if (reaction.message.partial) await reaction.message.fetch();
        if (reaction.partial) await reaction.fetch();
        
    const { guild } = reaction.message;
    if (!guild) return;
    if (!guild.me.permissions.has("MANAGE_ROLES")) return;
    
        isEmoji = function(emoji) {
      const e = Discord.Util.parseEmoji(emoji);

      if (e.id === null) {
        return {
          name: e.name,
          id: e.id,
          animated: e.animated,
          response: false
        }
      } else {
        return {
          name: e.name,
          id: e.id,
          animated: e.animated,
          response: true
        }
      }
    }
    
    const member = guild.members.cache.get(user.id);
    
    await Schema.findOne({
        guild_id: guild.id,
        msg_id: reaction.message.id
    }, async (err, db) => {
        if (!db) return;
        if (reaction.message.id != db.msg_id) return;
        
        const data = db.rcs;
        
        for (let i in data) {
            if (reaction.emoji.id === null) {
                if (reaction.emoji.name === data[i].emoji) {
                    member.roles.add(data[i].roleId, ['reaction role']).catch(err => console.log(err));
                }
            } else {
                if (reaction.emoji.id === data[i].emoji) {
                    member.roles.add(data[i].roleId, ['reaction role']).catch(err => console.log(err));
                }
         }
      }
    });
    },
};```
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Intents

You need the GUILD_MESSAGE_REACTIONS in your client

about 4 years ago · Santiago Gelvez 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!