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:
parent
66fbc34df6
commit
ce6053d3df
16
src/index.js
16
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
|
||||
})
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue