Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!