Lots of changes

This commit is contained in:
dragonfire535
2017-10-07 11:18:08 -04:00
parent e81226dbd6
commit a006a8a8de
32 changed files with 68 additions and 53 deletions
+25
View File
@@ -0,0 +1,25 @@
const { Command } = require('discord.js-commando');
const snekfetch = require('snekfetch');
module.exports = class CatCommand extends Command {
constructor(client) {
super(client, {
name: 'cat',
aliases: ['neko', 'kitty'],
group: 'random-res',
memberName: 'cat',
description: 'Responds with a random cat image.',
clientPermissions: ['ATTACH_FILES']
});
}
async run(msg) {
try {
const { body } = await snekfetch
.get('http://random.cat/meow');
return msg.say({ files: [body.file] });
} catch (err) {
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};