Files
xiao/commands/random-res/joke.js
T
Daniel Odendahl Jr 613ba678f6 Joke Command
2017-08-17 22:53:56 +00:00

21 lines
477 B
JavaScript

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);
}
};