From ce6053d3dfeb99afc06185fa6c26ed48a6c1257a Mon Sep 17 00:00:00 2001 From: fox3455 Date: Tue, 4 Aug 2020 10:25:20 -0400 Subject: [PATCH] Added the while loop to bot. Added rough version of the while loop to the bot to keep game going. I need to be able to test the bot to see where it doesn't work since I don't code in JS. --- src/index.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index d783b2f..9c42b8f 100644 --- a/src/index.js +++ b/src/index.js @@ -96,14 +96,24 @@ client.on('message', async message => { }) } - message.reply("Let's start!").then(() => { + //message.reply should start the game and call the first user based on the + //random user generator from our array + message.reply("Let's start! <@" + value + ">").then(() => { }) message.awaitReactions(filter, {max: 1, time: 30000, errors: ['time']}) .then(collected => { const reaction = collected.first(); - if (reaction.emoji === client.emojis.cache.get(config.emoteID)) { + //VERY rough while statement should maybe work...? Need to update the bot and see + //what happens when it runs since I don't write in JS + while True: + if (reaction.emoji === client.emojis.cache.get(config.emoteID)): + message.reply("Let's start! <@" + value + ">") + .then(() => { + message.awaitReactions(filter, {max: 1, time: 30000, errors: ['time']}) + } - } + else: + break }) } });