mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 18:29:14 +02:00
More Prettify
This commit is contained in:
@@ -27,14 +27,14 @@ module.exports = class BattleCommand extends Command {
|
||||
if (opponent.id === msg.author.id) return msg.say('You cannot fight yourself!');
|
||||
if (this.fighting.has(msg.guild.id)) return msg.say('There is already a fight in this server...');
|
||||
this.fighting.add(msg.guild.id);
|
||||
await msg.say(`${opponent.username}, do you accept this challenge? Yes or No?`);
|
||||
await msg.say(`**${opponent.username}**, do you accept this challenge? **_Y_es** or **No**?`);
|
||||
try {
|
||||
const verify = await msg.channel.awaitMessages(res => res.author.id === opponent.id, {
|
||||
max: 1,
|
||||
time: 15000,
|
||||
errors: ['time']
|
||||
});
|
||||
if (verify.first().content.toLowerCase() === 'yes') {
|
||||
if (['yes', 'y'].includes(verify.first().content.toLowerCase())) {
|
||||
let userHP = 500;
|
||||
let oppoHP = 500;
|
||||
let userTurn = true;
|
||||
@@ -117,8 +117,8 @@ module.exports = class BattleCommand extends Command {
|
||||
this.fighting.delete(msg.guild.id);
|
||||
return msg.say(stripIndents`
|
||||
The match is over!
|
||||
**Winner:** ${(userHP > oppoHP) ? `${msg.author.username} (${userHP})` : `${opponent.username} (${oppoHP})`}
|
||||
**Loser:** ${(userHP > oppoHP) ? `${opponent.username} (${oppoHP})` : `${msg.author.username} (${userHP})`}
|
||||
**Winner: ${(userHP > oppoHP) ? `${msg.author.username}** (${userHP})` : `${opponent.username}** (${oppoHP})`}
|
||||
**Loser: ${(userHP > oppoHP) ? `${opponent.username}** (${oppoHP})` : `${msg.author.username}** (${userHP})`}
|
||||
`);
|
||||
} else {
|
||||
this.fighting.delete(msg.guild.id);
|
||||
|
||||
Reference in New Issue
Block a user