Joke Command

This commit is contained in:
Daniel Odendahl Jr
2017-08-17 22:53:56 +00:00
parent a395b07632
commit 613ba678f6
4 changed files with 21 additions and 254 deletions
+20
View File
@@ -0,0 +1,20 @@
const Command = require('../../structures/Command');
const snekfetch = require('snekfetch');
module.exports = class JokeCommand extends Command {
constructor(client) {
super(client, {
name: 'joke',
group: 'random-res',
memberName: 'joke',
description: 'Responds with a random joke.'
});
}
async run(msg) {
const { body } = await snekfetch
.get('https://icanhazdadjoke.com/')
.set({ Accept: 'application/json' });
return msg.say(body.joke);
}
};