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

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

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