Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

90
Vistas
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 Respuestas
Responde la pregunta

0

Intents

You need the GUILD_MESSAGE_REACTIONS in your client

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda