Clean up code

This commit is contained in:
Dragon Fire
2019-11-11 23:17:07 -05:00
parent 9c50755843
commit 03da40c027
+5 -4
View File
@@ -42,13 +42,14 @@ module.exports = class RussianRouletteCommand extends Command {
while (!winner) {
const player = userTurn ? msg.author : opponent;
const notPlayer = userTurn ? msg.author : opponent;
await msg.say(stripIndents`
**${player.tag}** pulls the trigger... **And ${gun[round] ? 'dies!**' : 'lives...**'}
${opponent.bot ? 'Continue?' : `Will you take the gun, ${notPlayer}?`} (${8 - round - 1} shots left)
`);
if (gun[round]) {
await msg.say(`**${player.tag}** pulls the trigger... **And dies!**`);
winner = notPlayer;
} else {
await msg.say(stripIndents`
**${player.tag}** pulls the trigger... **And lives...**
${opponent.bot ? 'Continue?' : `Will you take the gun, ${notPlayer}?`} (${8 - round - 1} shots left)
`);
const keepGoing = await verify(msg.channel, opponent.bot ? msg.author : notPlayer);
if (!keepGoing) winner = notPlayer;
round++;