This commit is contained in:
Daniel Odendahl Jr
2017-06-17 03:26:31 +00:00
parent 5bb78126a9
commit fd4e35533a
129 changed files with 322 additions and 319 deletions
+30
View File
@@ -0,0 +1,30 @@
const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags');
const answers = require('../../assets/json/8-ball');
module.exports = class MagicBallCommand extends Command {
constructor(client) {
super(client, {
name: '8-ball',
group: 'random-res',
memberName: '8-ball',
description: 'Asks your question to the Magic 8 Ball.',
args: [
{
key: 'question',
prompt: 'What do you want to ask the 8 ball?',
type: 'string'
}
]
});
}
run(msg, args) {
const { question } = args;
const answer = answers[Math.floor(Math.random() * answers.length)];
return msg.say(stripIndents`
Question: ${question}
:8ball: ${answer} :8ball:
`);
}
};
+26
View File
@@ -0,0 +1,26 @@
const Command = require('../../structures/Command');
module.exports = class ChooseCommand extends Command {
constructor(client) {
super(client, {
name: 'choose',
group: 'random-res',
memberName: 'choose',
description: 'Chooses between options you provide.',
args: [
{
key: 'choices',
prompt: 'What choices do you want me pick from?',
type: 'string',
infinite: true
}
]
});
}
run(msg, args) {
const { choices } = args;
const choice = choices[Math.floor(Math.random() * choices.length)];
return msg.say(`I choose ${choice}!`);
}
};
+19
View File
@@ -0,0 +1,19 @@
const Command = require('../../structures/Command');
const sides = ['heads', 'tails'];
module.exports = class CoinFlipCommand extends Command {
constructor(client) {
super(client, {
name: 'coin',
aliases: ['coin-flip', 'flip'],
group: 'random-res',
memberName: 'coin',
description: 'Flips a coin.'
});
}
run(msg) {
const side = sides[Math.floor(Math.random() * sides.length)];
return msg.say(`It landed on ${side}!`);
}
};
+27
View File
@@ -0,0 +1,27 @@
const Command = require('../../structures/Command');
const compliments = require('../../assets/json/compliment');
module.exports = class ComplimentCommand extends Command {
constructor(client) {
super(client, {
name: 'compliment',
group: 'random-res',
memberName: 'compliment',
description: 'Compliments a user.',
args: [
{
key: 'user',
prompt: 'What user do you want to compliment?',
type: 'user',
default: ''
}
]
});
}
run(msg, args) {
const user = args.user || msg.author;
const compliment = compliments[Math.floor(Math.random() * compliments.length)];
return msg.say(`${user.username}, ${compliment}`);
}
};
+18
View File
@@ -0,0 +1,18 @@
const Command = require('../../structures/Command');
const facts = require('../../assets/json/fact-core');
module.exports = class FactCoreCommand extends Command {
constructor(client) {
super(client, {
name: 'fact-core',
group: 'random-res',
memberName: 'fact-core',
description: 'Responds with a random Fact Core quote.'
});
}
run(msg) {
const fact = facts[Math.floor(Math.random() * facts.length)];
return msg.say(fact);
}
};
+18
View File
@@ -0,0 +1,18 @@
const Command = require('../../structures/Command');
const fishes = [':fish:', ':tropical_fish:', ':blowfish:', ':wrench:'];
module.exports = class FishyCommand extends Command {
constructor(client) {
super(client, {
name: 'fishy',
group: 'random-res',
memberName: 'fishy',
description: 'Catches a fish.'
});
}
run(msg) {
const fish = fishes[Math.floor(Math.random() * fishes.length)];
return msg.say(`You caught a: ${fish}`);
}
};
+19
View File
@@ -0,0 +1,19 @@
const Command = require('../../structures/Command');
const fortunes = require('../../assets/json/fortune');
module.exports = class FortuneCommand extends Command {
constructor(client) {
super(client, {
name: 'fortune',
aliases: ['fortune-cookie'],
group: 'random-res',
memberName: 'fortune',
description: 'Responds with a random fortune.'
});
}
run(msg) {
const fortune = fortunes[Math.floor(Math.random() * fortunes.length)];
return msg.say(fortune);
}
};
+30
View File
@@ -0,0 +1,30 @@
const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags');
const answers = require('../../assets/json/magic-conch');
module.exports = class MagicConchCommand extends Command {
constructor(client) {
super(client, {
name: 'magic-conch',
group: 'random-res',
memberName: 'magic-conch',
description: 'Asks your question to the Magic Conch.',
args: [
{
key: 'question',
prompt: 'What do you want to ask the magic conch?',
type: 'string'
}
]
});
}
run(msg, args) {
const { question } = args;
const answer = answers[Math.floor(Math.random() * answers.length)];
return msg.say(stripIndents`
Question: ${question}
:shell: ${answer} :shell:
`);
}
};
+48
View File
@@ -0,0 +1,48 @@
const Command = require('../../structures/Command');
const { lastNames, maleNames, femaleNames } = require('../../assets/json/name');
module.exports = class RandomNameCommand extends Command {
constructor(client) {
super(client, {
name: 'name',
group: 'random-res',
memberName: 'name',
description: 'Responds with a random name, with the gender of your choice.',
args: [
{
key: 'gender',
prompt: 'Which gender do you want to generate a name for?',
type: 'string',
default: 'both',
validate: (gender) => {
if (['male', 'female', 'both'].includes(gender.toLowerCase())) return true;
else return 'Please enter either `male`, `female`, or `both`.';
},
parse: (gender) => gender.toLowerCase()
}
]
});
}
run(msg, args) {
const { gender } = args;
const lastName = lastNames[Math.floor(Math.random() * lastNames.length)];
if (gender === 'male') {
const name = maleNames[Math.floor(Math.random() * maleNames.length)];
return msg.say(`${name} ${lastName}`);
} else if (gender === 'female') {
const name = femaleNames[Math.floor(Math.random() * femaleNames.length)];
return msg.say(`${name} ${lastName}`);
} else if (gender === 'both') {
const genders = ['male', 'female'];
const randomGender = genders[Math.floor(Math.random() * genders.length)];
if (randomGender === 'male') {
const name = maleNames[Math.floor(Math.random() * maleNames.length)];
return msg.say(`${name} ${lastName}`);
} else if (randomGender === 'female') {
const name = femaleNames[Math.floor(Math.random() * femaleNames.length)];
return msg.say(`${name} ${lastName}`);
}
}
}
};
+18
View File
@@ -0,0 +1,18 @@
const Command = require('../../structures/Command');
const genders = ['boy', 'girl'];
module.exports = class OffspringCommand extends Command {
constructor(client) {
super(client, {
name: 'offspring',
group: 'random-res',
memberName: 'offspring',
description: 'Decides if your new child will be a boy or a girl.'
});
}
run(msg) {
const gender = genders[Math.floor(Math.random() * genders.length)];
return msg.say(`It's a ${gender}!`);
}
};
+19
View File
@@ -0,0 +1,19 @@
const Command = require('../../structures/Command');
const sides = ['on nothing', 'on NaN', 'on 0', 'in the air', 'on null'];
module.exports = class QuantumCoinCommand extends Command {
constructor(client) {
super(client, {
name: 'quantum-coin',
aliases: ['q-coin'],
group: 'random-res',
memberName: 'quantum-coin',
description: 'Flips a coin that lands on some form of nothing.'
});
}
run(msg) {
const side = sides[Math.floor(Math.random() * sides.length)];
return msg.say(`It landed ${side}.`);
}
};
+26
View File
@@ -0,0 +1,26 @@
const Command = require('../../structures/Command');
module.exports = class RateWaifuCommand extends Command {
constructor(client) {
super(client, {
name: 'rate-waifu',
aliases: ['waifu'],
group: 'random-res',
memberName: 'rate-waifu',
description: 'Rates your waifu.',
args: [
{
key: 'waifu',
prompt: 'Who do you want to rate?',
type: 'string'
}
]
});
}
run(msg, args) {
const { waifu } = args;
const rating = Math.floor(Math.random() * 10) + 1;
return msg.say(`I'd give ${waifu} a ${rating}/10!`);
}
};
+27
View File
@@ -0,0 +1,27 @@
const Command = require('../../structures/Command');
const roasts = require('../../assets/json/roast');
module.exports = class RoastCommand extends Command {
constructor(client) {
super(client, {
name: 'roast',
group: 'random-res',
memberName: 'roast',
description: 'Roasts a user.',
args: [
{
key: 'user',
prompt: 'What user do you want to roast?',
type: 'user',
default: ''
}
]
});
}
run(msg, args) {
const user = args.user || msg.author;
const roast = roasts[Math.floor(Math.random() * roasts.length)];
return msg.say(`${user.username}, ${roast}`);
}
};
+28
View File
@@ -0,0 +1,28 @@
const Command = require('../../structures/Command');
module.exports = class RollCommand extends Command {
constructor(client) {
super(client, {
name: 'roll',
aliases: ['dice'],
group: 'random-res',
memberName: 'roll',
description: 'Rolls a dice with a maximum value of your choice.',
args: [
{
key: 'value',
label: 'maximum number',
prompt: 'What is the maximum number you wish to appear?',
type: 'integer',
default: 6
}
]
});
}
run(msg, args) {
const { value } = args;
const roll = Math.floor(Math.random() * value) + 1;
return msg.say(`You rolled a ${roll}.`);
}
};
+17
View File
@@ -0,0 +1,17 @@
const Command = require('../../structures/Command');
module.exports = class RouletteCommand extends Command {
constructor(client) {
super(client, {
name: 'roulette',
group: 'random-res',
memberName: 'roulette',
description: 'Chooses a random member of the server.',
guildOnly: true
});
}
run(msg) {
return msg.say(`I choose ${msg.guild.members.random().displayName}!`);
}
};
+27
View File
@@ -0,0 +1,27 @@
const Command = require('../../structures/Command');
module.exports = class ShipCommand extends Command {
constructor(client) {
super(client, {
name: 'ship',
aliases: ['rate'],
group: 'random-res',
memberName: 'ship',
description: 'Ships things/people together.',
args: [
{
key: 'things',
prompt: 'What do you want to ship together?',
type: 'string',
infinite: true
}
]
});
}
run(msg, args) {
const { things } = args;
const rating = Math.floor(Math.random() * 100) + 1;
return msg.say(`I'd give ${things.join(' and ')} a ${rating}%!`);
}
};