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

92
Visualizações
AwaitingReactions is practically not working on mine. Discord.js

I dont know why but i followed the guide in discord.js about awaiting reactions but it seems it doesnt work on mine. I dont know why. Whenever i hit the emoji it doesnt collect it. I pretty much goes to every answered question here in stackoverflow but i still cannot fix it.

const { Client, Message, MessageEmbed } = require("discord.js");

module.exports = {
  name: "error",
  /**
   * @param {Client} client
   * @param {Message} message
   * @param {String[]} args
   */
  run: async (client, message, args) => {
    message.delete({ timeout:2000 })
    var randstr = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5);
    var randnum = Math.floor(Math.random() * 100);
    var comb = randstr + randnum;
    var sayEmbed = new MessageEmbed()
        .setTitle('Console Error #'+ '`' + comb + '`' + ' sent by ' + message.member.user.tag)
        .setDescription('```' + args.join(" ") + '```')
        .setTimestamp()
        .setColor("BLACK")
        .setTimestamp()
        .setFooter("Copyright ©️  2022, Mythic Realms, or its associates. All Rights Reserved.")

    message.channel.send({embed: sayEmbed}).then(embedMessage => {
    embedMessage.react('✅');
    })
    
        const filter = (reaction, user) => reaction.emoji.name === '✅' && user.id === message.author.id;
        const collector = message.createReactionCollector(filter, { max: 1, time: 5 * 60 * 1000 });
        
    collector.on('collect', () => {
      message.clearReactions();

      console.log('SUCCESS');
    });
  },
};

Please help with this bot :< thank you.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You're creating a message collector at message whereas the reaction itself is at embedMessage.

embedMessage.createReactionCollector would be the correct.

Plus, said embedMessage is within the scope of the message.send().then()

You can either assign the return value of the message.send() promise to embedMessage on the same level so it is accessible by the collector or set the collector inside the then() function from message.send()

const embedMessage = await message.send(...);
const collector = embedMessage.createReactionCollector(...);

or

message.send(...).then(embedMessage => {
  const collector = embedMessage.createReactionCollector(...);
});
about 4 years ago · Juan Pablo Isaza 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