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

87
Visualizações
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 Respostas
Responde à pergunta

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