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

86
Views
how to capture the reaction of an emoji in a message

when a message receives a reaction or emoji, I want to save the letter "y" in Wish. I need to use emoji in client.on("message", (message), not another, the next error is ReferenceError: emoji is not defined but i have no idea how to solve it

const { Client, Intents } = require("discord.js-selfbot");
const client = new Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS],
});

let token = "";

client.on('ready', () => {
    console.log('Ok!');
 });

 let ListWish = ["โค","๐Ÿ’–","๐Ÿ’˜"];
 let Wish;

client.on("message", (message) => {
if(ListWish.includes(emoji.name)){
    Wish = 'y';
}

if(message.embeds.length >= 0) 
// Check if the Message has embed or not
      {
        let embed = message.embeds
        for(let i = 0; i < embed.length; i++)
        {
          if (!embed[i] || !embed[i].description) return;
          // check each embed if it has description or not, if it doesnt then do nothing
          {
            if(Wish === 'y'){
            message.channel.send("Have emoji heart")
            }
          }
        }
      }
});  
client.login(token); 
about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

You can use the Message.awaitReactions() method to listen for reactions on a certain message without the need of using client.on('event').

The documentation already contains code that easily summarizes how to use it, so I won't write any code here.

Edit: I almost forgot to add this, I am pretty sure you can pass in a callback after the options, so there is no need to use .then().

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!