// NOTE: This wont work without a proper index and command handler! If you're interested in implementing this code, I'd suggest watching WornOffKeys's tutorials on getting started and a basic command handler! command(client, 'rps', message => { const rps = ['Rock', 'Paper', 'Scissors'] const randomIndex = Math.floor(Math.random() * rps.length) const randomRPS = rps[randomIndex] const author = message.author.id let title = '' const Embed = new Discord.MessageEmbed() .setTitle('RPS') .setDescription(`Please pick one of the below:`) .addField('🔨 Rock', "The almighty, the all-smashing! IT'S ROCK!\nCan smash: ✂️ Scissors") .addField('📰 Paper', "Who's that in your printer!? IT'S PAPER OF COURSE!\nCan smash: 🔨 Rock") .addField('✂️ Scissors', 'The sharpest, the 4-times champion.. SCIIIIIISOOOOORS!!!\nCan smash: 📰 Paper') .addField('❌', 'Not a fighter but.. will stop your game?..') .setFooter("Bot created by Bqre#0001", 'https://i.imgur.com/trvzFSz.png') .setColor(3426654) message.channel.send(Embed).then(async message => { message.react('🔨') .then(() => message.react('📰')) .then(() => message.react('✂️')) .then(() => message.react('❌')) const filter2 = (reaction, user) => { return ['🔨', '📰', '✂️', '❌'].includes(reaction.emoji.name) && user.id === author; } message.awaitReactions(filter2, { max: 1, time: 30000, errors: ['time'] }).then(collected => { const reaction = collected.first(); if (reaction.emoji.name === '🔨') { if (randomRPS === 'Rock') { title = 'TIE!' } else if (randomRPS === 'Scissors') { title = 'YOU WIN!' } else if (randomRPS === 'Paper') { title = 'YOU LOSE!' } } else if (reaction.emoji.name === '📰') { if (randomRPS === 'Rock') { title = 'YOU WIN!' } else if (randomRPS === 'Scissors') { title = 'YOU LOSE!' } else if (randomRPS === 'Paper') { title = 'TIE!' } } else if (reaction.emoji.name === '✂️') { if (randomRPS === 'Rock') { title = 'YOU LOSE!' } else if (randomRPS === 'Scissors') { title = 'TIE' } else if (randomRPS === 'Paper') { title = 'YOU WIN!' } } else if (reaction.emoji.name === '') { return message.channel.send('Game Ended.') } const EmbedFinal = new Discord.MessageEmbed() .setTitle(title) .setDescription(`I picked ${randomRPS}`) .setColor(3426654) .setFooter("Bot created by Bqre#0001", 'https://i.imgur.com/trvzFSz.png') message.channel.send(EmbedFinal) }) }) })