client.on('message', async msg => {
if (['โ','๐๏ธ','โ๏ธ'].includes(msg.body)) {
const RPS = () => {
const emojis = ['โ','๐๏ธ','โ๏ธ'];
const random = Math.floor(Math.random() * 3);
return emojis[random];
};
const emoji = RPS();
const beats = {['โ']:'โ๏ธ', ['๐๏ธ']:'โ', ['โ๏ธ']:'๐๏ธ'};
msg.reply(emoji);
if(msg.body === emoji) {
client.sendMessage(msg.from,"It's a draw ๐");
} else if (beats[msg.body] === emoji) {
client.sendMessage(msg.from,'You won ๐คฏ');
} else {
client.sendMessage(msg.from,'You lost ๐');
}
}
});
user rock interactions r working fine, but user's paper and scissor r always losing against me regardless of my generated emoji