mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 16:19:12 +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 round = 0;
|
||||||
let loser = null;
|
let loser = null;
|
||||||
let winner = null;
|
let winner = null;
|
||||||
|
const wallOfShame = [];
|
||||||
while (!loser && !winner) {
|
while (!loser && !winner) {
|
||||||
const player = players.get(turn[0]);
|
const player = players.get(turn[0]);
|
||||||
turn.push(turn[0]);
|
turn.push(turn[0]);
|
||||||
@@ -76,6 +77,7 @@ module.exports = class RussianRouletteCommand extends Command {
|
|||||||
if (first) first = false;
|
if (first) first = false;
|
||||||
const keepGoing = await verify(msg.channel, nextPlayer.user);
|
const keepGoing = await verify(msg.channel, nextPlayer.user);
|
||||||
if (keepGoing) break;
|
if (keepGoing) break;
|
||||||
|
wallOfShame.push(players.get(next).user.toString());
|
||||||
players.delete(next);
|
players.delete(next);
|
||||||
removeFromArray(turn, next);
|
removeFromArray(turn, next);
|
||||||
}
|
}
|
||||||
@@ -86,8 +88,20 @@ module.exports = class RussianRouletteCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.client.games.delete(msg.channel.id);
|
this.client.games.delete(msg.channel.id);
|
||||||
if (winner) return msg.say(`The winner is ${winner.user}!`);
|
if (winner) {
|
||||||
return msg.say(`The loser is ${loser.user}!`);
|
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) {
|
} catch (err) {
|
||||||
this.client.games.delete(msg.channel.id);
|
this.client.games.delete(msg.channel.id);
|
||||||
throw err;
|
throw err;
|
||||||
|
|||||||
Reference in New Issue
Block a user