mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
const Command = require('../../structures/Command');
|
|
const Random = require('random-js');
|
|
|
|
module.exports = class ShipCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'ship',
|
|
group: 'analyze',
|
|
memberName: 'ship',
|
|
description: 'Ships two users together.',
|
|
args: [
|
|
{
|
|
key: 'first',
|
|
label: 'first user',
|
|
prompt: 'Who is the first user in the ship?',
|
|
type: 'user'
|
|
},
|
|
{
|
|
key: 'second',
|
|
label: 'second user',
|
|
prompt: 'Who is the second user in the ship?',
|
|
type: 'user',
|
|
default: msg => msg.author
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
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
|
|
? '\nBut you\'re still rejected. Sorry.'
|
|
: '';
|
|
const random = new Random(Random.engines.mt19937().seed(Math.abs(first.id - second.id)));
|
|
const level = random.integer(0, 100);
|
|
return msg.say(`${first.username} and ${second.username} have a compatability of... **${level}%**!${botText}`);
|
|
}
|
|
};
|