Improve ship command

This commit is contained in:
Daniel Odendahl Jr
2019-03-15 14:34:32 +00:00
parent 95a6b44ffa
commit 162a83ae2b
2 changed files with 8 additions and 5 deletions
+7 -4
View File
@@ -29,14 +29,17 @@ module.exports = class ShipCommand extends Command {
run(msg, { first, second }) {
if (first.id === second.id) return msg.reply('Shipping someone with themselves would be pretty weird.');
const botText = first.id === this.client.user.id || second.id === this.client.user.id
? `But ${first.id === msg.author.id || second.id === msg.author.id ? 'you\'re' : 'they\'re'} still rejected.`
: '';
const authorInvolved = first.id === msg.author.id || second.id === msg.author.id;
const random = new Random(Random.engines.mt19937().seed(Math.abs(first.id - second.id)));
const level = random.integer(0, 100);
const botText = first.id === this.client.user.id || second.id === this.client.user.id
? level >= 70
? `But ${authorInvolved ? 'you\'re' : 'they\'re'} still rejected.`
: `Haha even a bot thinks ${authorInvolved ? 'you\'re' : 'they\'re'} lame.`
: '';
return msg.say(oneLine`
${first.id === this.client.user.id ? 'Me' : first.username} and
${second.id === this.client.user.id ? 'me' : second.username} have a compatability of... **${level}%**! ${botText}
${second.id === this.client.user.id ? 'I' : second.username} have a compatability of... **${level}%**! ${botText}
`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "102.0.0",
"version": "102.0.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {