Waifu, change rate-waifu to rate

This commit is contained in:
Daniel Odendahl Jr
2018-05-19 11:51:12 +00:00
parent 734111f3ba
commit 3732030d77
7 changed files with 68 additions and 52 deletions
-24
View File
@@ -1,24 +0,0 @@
const { Command } = require('discord.js-commando');
const { randomFromImgurAlbum } = require('../../util/Util');
module.exports = class KarenCommand extends Command {
constructor(client) {
super(client, {
name: 'karen',
aliases: ['ayaya'],
group: 'random',
memberName: 'karen',
description: 'Responds with a random image of Karen.',
clientPermissions: ['ATTACH_FILES']
});
}
async run(msg) {
try {
const karen = await randomFromImgurAlbum('3oLAP');
return msg.say({ files: [karen] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
-25
View File
@@ -1,25 +0,0 @@
const { Command } = require('discord.js-commando');
module.exports = class RateWaifuCommand extends Command {
constructor(client) {
super(client, {
name: 'rate-waifu',
aliases: ['waifu', 'rate'],
group: 'random',
memberName: 'rate-waifu',
description: 'Rates a waifu.',
args: [
{
key: 'waifu',
prompt: 'Who do you want to rate?',
type: 'string',
max: 1950
}
]
});
}
run(msg, { waifu }) {
return msg.say(`I'd give ${waifu} a ${Math.floor(Math.random() * 10) + 1}/10!`);
}
};
+25
View File
@@ -0,0 +1,25 @@
const { Command } = require('discord.js-commando');
module.exports = class RateCommand extends Command {
constructor(client) {
super(client, {
name: 'rate',
aliases: ['rate-waifu'],
group: 'random',
memberName: 'rate',
description: 'Rates something.',
args: [
{
key: 'thing',
prompt: 'Who do you want to rate?',
type: 'string',
max: 1950
}
]
});
}
run(msg, { thing }) {
return msg.say(`I'd give ${thing} a ${Math.floor(Math.random() * 10) + 1}/10!`);
}
};
+26
View File
@@ -0,0 +1,26 @@
const { Command } = require('discord.js-commando');
const { randomFromImgurAlbum } = require('../../util/Util');
const waifus = require('../../assets/json/waifu');
module.exports = class WaifuCommand extends Command {
constructor(client) {
super(client, {
name: 'waifu',
group: 'random',
memberName: 'waifu',
description: 'Responds with a random image of one of dragonfire535\'s waifu.',
clientPermissions: ['ATTACH_FILES']
});
}
async run(msg) {
const waifuKeys = Object.keys(waifus);
const waifu = waifuKeys[Math.floor(Math.random() * waifuKeys.length)];
try {
const waifuImage = await randomFromImgurAlbum(waifu);
return msg.say(waifu, { files: [waifuImage] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};