Fox Command

This commit is contained in:
Daniel Odendahl Jr
2018-07-10 02:52:39 +00:00
parent 3450d6a8c8
commit 4083427231
3 changed files with 26 additions and 2 deletions
+23
View File
@@ -0,0 +1,23 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
module.exports = class FoxCommand extends Command {
constructor(client) {
super(client, {
name: 'fox',
group: 'random',
memberName: 'fox',
description: 'Responds with a random fox image.',
clientPermissions: ['ATTACH_FILES']
});
}
async run(msg) {
try {
const { body } = await request.get('https://randomfox.ca/floof/');
return msg.say({ files: [body.image] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};