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

252
Visualizações
Discord js v12 Send message if someone reacts to embed

I'm currently making a discord bot using discord.js v12 (yes 12 not 13), I made a command that the bot sends an embed and reacts to it, in the filter I set the max to 2 (max: 2, ...). I want that every time someone reacts with this embed that like his name will be send in the channel. My current concept is this(it's in a function because I don't want to but everything in the switch):

async function fun_2p() {
  const reactionMessage2p = await message.channel.send(embed2p);
  const filter2p = (reaction, user) => user.id !== bot;

  await reactionMessage2p.react('🍻')

  reactionMessage2p.awaitReactions( filter2p, {max: 2, time: 20000, errors: ['time'] }).then(collected => {
                    
  })
}

Right before the last }) should be the code for the answer (I guess).

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Use Message#createReactionCollector instead, and listen for the collect event

const reactionMessage2p = await message.channel.send(embed2p);
const filter2p = (reaction, user) => user.id !== bot

await reactionMessage2p.react('🍻')

const collector = reactionMessage2p.createReactionCollector(filter2p, {max: 2, time: 20000, errors: ['time'] })

collector.on("collect", (reaction, user) => {
  reaction.message.channel.send(`${user.tag} has just reacted to the message`)
})

You can change the message to whatever you want

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