mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 06:37:32 +02:00
Joke Command
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user