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

98
Views
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 answers
Answer question

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 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!