mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add wall of shame to russian roulette
This commit is contained in:
@@ -49,6 +49,7 @@ module.exports = class RussianRouletteCommand extends Command {
|
||||
let round = 0;
|
||||
let loser = null;
|
||||
let winner = null;
|
||||
const wallOfShame = [];
|
||||
while (!loser && !winner) {
|
||||
const player = players.get(turn[0]);
|
||||
turn.push(turn[0]);
|
||||
@@ -76,6 +77,7 @@ module.exports = class RussianRouletteCommand extends Command {
|
||||
if (first) first = false;
|
||||
const keepGoing = await verify(msg.channel, nextPlayer.user);
|
||||
if (keepGoing) break;
|
||||
wallOfShame.push(players.get(next).user.toString());
|
||||
players.delete(next);
|
||||
removeFromArray(turn, next);
|
||||
}
|
||||
@@ -86,8 +88,20 @@ module.exports = class RussianRouletteCommand extends Command {
|
||||
}
|
||||
}
|
||||
this.client.games.delete(msg.channel.id);
|
||||
if (winner) return msg.say(`The winner is ${winner.user}!`);
|
||||
return msg.say(`The loser is ${loser.user}!`);
|
||||
if (winner) {
|
||||
return msg.say(stripIndents`
|
||||
The winner is ${winner.user}!
|
||||
|
||||
__**Wall Of Shame:**__
|
||||
${wallOfShame.length ? wallOfShame.join('\n') : 'No one!'}
|
||||
`);
|
||||
}
|
||||
return msg.say(stripIndents`
|
||||
The loser is ${loser.user}!
|
||||
|
||||
__**Wall Of Shame:**__
|
||||
${wallOfShame.length ? wallOfShame.join('\n') : 'No one!'}
|
||||
`);
|
||||
} catch (err) {
|
||||
this.client.games.delete(msg.channel.id);
|
||||
throw err;
|
||||
|
||||
Reference in New Issue
Block a user