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

164
Visualizações
How can I make the reaction collector choose the first 2 reactions?

So I try to make reaction collector that pause/play the music after user react to the reaction, But my collector stops when user react 1 time (the user can't react twice, only once), how can i fix it? this is my code:

 queue.textChannel.send(thing).then((question) => {
          question.react('⏸');
          question.react('▶️');
          question.react('⬅️');
          question.react('⏹️');


          const filter = (reaction, user) => {
             return ['⏹️', '⬅️','⏸','▶️'].includes(reaction.emoji.name) && !user.bot;
          };

          const collector = question.createReactionCollector(filter, {
             max: 1,
             time: 0
          }); 


          collector.on('end', (collected, reason) => {
             if (reason === 'time') {
                msg.reply('Times Up');
             } else {

                const userReaction = collected.array()[0];
 
                const emoji = userReaction._emoji.name;
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I fixed it by changing the collector from 'end' to 'collect' and deleted the max: option.

            queue.textChannel.send(thing).then((question) => {
          question.react('⏸');
          question.react('▶️');
          question.react('⬅️');
          question.react('⏹️');


          const filter = (reaction, user) => {
             return ['⏹️', '⬅️','⏸','▶️'].includes(reaction.emoji.name) && !user.bot;
          };

      const collector = question.createReactionCollector(filter, { time: 400000 });



      collector.on('collect', (reaction, reactionCollector) => {

 
                const emoji = reaction.emoji.name;

@ZsoltMeszaros Helped me with the right answer.

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