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.
This commit is contained in:
fox3455 2020-08-04 10:25:20 -04:00 committed by GitHub
parent 66fbc34df6
commit ce6053d3df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -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
})
}
});