random-js is cool

This commit is contained in:
Daniel Odendahl Jr
2018-04-21 01:30:16 +00:00
parent 116582e6a8
commit 9f04d0f8dd
8 changed files with 72 additions and 57 deletions
+4 -3
View File
@@ -1,4 +1,5 @@
const { Command } = require('discord.js-commando');
const Random = require('random-js');
const texts = require('../../assets/json/coolness');
module.exports = class CoolnessCommand extends Command {
@@ -21,13 +22,13 @@ module.exports = class CoolnessCommand extends Command {
run(msg, { user }) {
const authorUser = user.id === msg.author.id;
const coolness = Math.round(((user.id / this.client.user.id) * 10) / 2);
if (user.id === this.client.user.id) return msg.reply('Me? I think I\'m the very best, like no one ever was.');
if (this.client.isOwner(user)) {
if (authorUser) return msg.reply('You\'re the best owner a bot could ask for! ❤');
return msg.reply(`Don't tell them I said this but I think ${user.username} smells like a sack of diapers.`);
}
const text = texts[Math.min(coolness, texts.length - 1)];
return msg.reply(`${authorUser ? 'You are' : `${user.username} is`} ${text}`);
const random = new Random(Random.engines.mt19937().seed(user.id));
const coolness = random.integer(0, texts.length - 1);
return msg.reply(`${authorUser ? 'You are' : `${user.username} is`} ${texts[coolness]}`);
}
};
+28
View File
@@ -0,0 +1,28 @@
const { Command } = require('discord.js-commando');
const Random = require('random-js');
module.exports = class DickCommand extends Command {
constructor(client) {
super(client, {
name: 'dick',
aliases: ['dick-size'],
group: 'analyze',
memberName: 'dick',
description: 'Determines your dick size.',
nsfw: true,
args: [
{
key: 'user',
prompt: 'What user do you want to determine the dick size of?',
type: 'user',
default: msg => msg.author
}
]
});
}
run(msg, { user }) {
const random = new Random(Random.engines.mt19937().seed(user.id));
return msg.reply(`8${'='.repeat(random.integer(0, 200))}D`);
}
};
+32
View File
@@ -0,0 +1,32 @@
const { Command } = require('discord.js-commando');
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'
}
]
});
}
run(msg, { first, second }) {
const random = new Random(Random.engines.mt19937().seed(first.id - second.id));
return msg.say(`I'd give ${first.username} and ${second.username} a ${random.integer(0, 100)}%!`);
}
};
-18
View File
@@ -1,18 +0,0 @@
const { Command } = require('discord.js-commando');
module.exports = class DickCommand extends Command {
constructor(client) {
super(client, {
name: 'dick',
aliases: ['dick-size'],
group: 'random',
memberName: 'dick',
description: 'Determines your dick size.',
nsfw: true
});
}
run(msg) {
return msg.say(`8${'='.repeat(Math.floor(Math.random() * 200) + 1)}D`);
}
};
-32
View File
@@ -1,32 +0,0 @@
const { Command } = require('discord.js-commando');
module.exports = class ShipCommand extends Command {
constructor(client) {
super(client, {
name: 'ship',
group: 'random',
memberName: 'ship',
description: 'Ships two people together.',
args: [
{
key: 'first',
label: 'first name',
prompt: 'Who is the first person in the ship?',
type: 'string',
max: 500
},
{
key: 'second',
label: 'second name',
prompt: 'Who is the second person in the ship?',
type: 'string',
max: 500
}
]
});
}
run(msg, { first, second }) {
return msg.say(`I'd give ${first} and ${second} a ${Math.floor(Math.random() * 100) + 1}%!`);
}
};