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

101
Visualizações
What to do after this to compare interaction.customId

I am trying to create a Multiplayer RPS in discord using Buttons but i cant seem to find a way to compare inteaction.customId of both collectors to get the result. The challenger and the Member who is challenged have to respond in their DMs.

Please tell me a way to get inteaction.customId from these two colletectors or a way through which i can determine Results.

This is the collector for challenger

acollector.on('collect', async (interaction) => {
                            if (interaction.customId === 'rock') {
                                RPSbuttons.components.forEach(e => e.setDisabled(true))
                                interaction.update({emebes: [RPSembed], components: [RPSbuttons]})
                                interaction.user.send('You Choose **Rock**!')
                            } else if (interaction.customId === 'paper') {
                                RPSbuttons.components.forEach(e => e.setDisabled(true))
                                interaction.update({emebes: [RPSembed], components: [RPSbuttons]})
                                interaction.user.send('You Choose **Paper**!')
                            } else if (interaction.customId === 'scissor') {
                                RPSbuttons.components.forEach(e => e.setDisabled(true))
                                interaction.update({emebes: [RPSembed], components: [RPSbuttons]})
                                interaction.user.send('You Choose **Scissors**!')
                            }

                        })

This is the collector for The member who is being challenged:

ocollector.on('collect', async (interaction) => {
                            if (interaction.customId === 'rock') {
                                RPSbuttons.components.forEach(e => e.setDisabled(true))
                                interaction.update({emebes: [RPSembed], components: [RPSbuttons]})
                                interaction.user.send('You Choose **Rock**!')
                            } else if (interaction.customId === 'paper') {
                                RPSbuttons.components.forEach(e => e.setDisabled(true))
                                interaction.update({emebes: [RPSembed], components: [RPSbuttons]})
                                interaction.user.send('You Choose **Paper**!')
                            } else if (interaction.customId === 'scissor') {
                                RPSbuttons.components.forEach(e => e.setDisabled(true))
                                interaction.update({emebes: [RPSembed], components: [RPSbuttons]})
                                interaction.user.send('You Choose **Scissors**!')
                            }

                        })```

about 4 years ago · Juan Pablo Isaza
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