Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

93
Visualizações
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 Respostas
Responde à pergunta

0

Intents

You need the GUILD_MESSAGE_REACTIONS in your client

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda