Home > Back-end >  Rock Paper Scissor Array Not Working Discord.js V12
Rock Paper Scissor Array Not Working Discord.js V12

Time:01-27

I am trying to build an RPS game in my Discord bot. I want to add the functionality that if the word you choose does not exist in the list, it will return a message. This is my code so far:

async execute(message, args, cmd, client, Discord, profileData) {
  if (!args.length)
    return message.channel.send('To keep it fair, also send your pick!'); //If you don't
  //send a second
  //argument.

  const list = ['rock', 'paper', 'scissor']; // What the bot accepts.

  const rps = ['Rock! - ⛰', 'Paper! -            
  •  Tags:  
  • Related