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

258
Views
I can't get my bot to recognize the reaction and respond to it (Discord.js)
const Discord = require ('discord.js')

module.exports.run = async (client, message, reaction, user) => {
        
        message.channel.send("Press **F** to pay respect!!").then(msg => {msg.react("<:pressf:861646469180948530>")})
        
        const filter = (reaction, user) => {
                return reaction.emoji.name === ' === "<:pressf:861646469180948530>' && user.id === message.author.id;
                
        };
        
        
        const collector = message.createReactionCollector( filter);
        
        
        collector.on('collect', (reaction, user) => {
                if (message.emoji.name === "<:pressf:861646469180948530>"){
                        message.channel.send("You pay respect!!")
                }
        })
        
};
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The problem is you're setting up the reaction collector on the original message. Try to wait for the sent one, and accept reactions on that:

module.exports.run = async (client, message, reaction, user) => {
  const sentMessage = await message.channel.send('Press **F** to pay respect!!');

  sentMessage.react('<:pressf:861646469180948530>');

  const filter = (reaction, user) =>
    // there was an extra  === " here
    reaction.emoji.name === '<:pressf:861646469180948530>' &&
    user.id === message.author.id;

  const collector = sentMessage.createReactionCollector(filter);

  collector.on('collect', (reaction, user) => {
    if (reaction.emoji.name === '<:pressf:861646469180948530>') {
      message.channel.send('You pay respect!!');
    }
  });
};
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!