mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
Make the message cleaner
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
|
const { stripIndents } = require('common-tags');
|
||||||
const { shuffle, verify } = require('../../util/Util');
|
const { shuffle, verify } = require('../../util/Util');
|
||||||
|
|
||||||
module.exports = class RussianRouletteCommand extends Command {
|
module.exports = class RussianRouletteCommand extends Command {
|
||||||
@@ -40,12 +41,16 @@ module.exports = class RussianRouletteCommand extends Command {
|
|||||||
let winner = null;
|
let winner = null;
|
||||||
while (!winner) {
|
while (!winner) {
|
||||||
const player = userTurn ? msg.author : opponent;
|
const player = userTurn ? msg.author : opponent;
|
||||||
await msg.say(`${player.tag} pulls the trigger... And **${gun[round] ? 'dies!**' : 'lives...** Continue?'}`);
|
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}?`}
|
||||||
|
`);
|
||||||
if (gun[round]) {
|
if (gun[round]) {
|
||||||
winner = userTurn ? opponent : msg.author;
|
winner = notPlayer;
|
||||||
} else {
|
} else {
|
||||||
const keepGoing = await verify(msg.channel, opponent.bot ? msg.author : player);
|
const keepGoing = await verify(msg.channel, opponent.bot ? msg.author : notPlayer);
|
||||||
if (!keepGoing) winner = userTurn ? opponent : msg.author;
|
if (!keepGoing) winner = notPlayer;
|
||||||
round++;
|
round++;
|
||||||
userTurn = !userTurn;
|
userTurn = !userTurn;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user