Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

88
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda