mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 14:20:51 +02:00
34 lines
749 B
JavaScript
34 lines
749 B
JavaScript
const Command = require('../../structures/Command');
|
|
const snekfetch = require('snekfetch');
|
|
|
|
module.exports = class ChuckNorrisCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'chuck-norris',
|
|
aliases: ['chuck', 'norris'],
|
|
group: 'random-res',
|
|
memberName: 'chuck-norris',
|
|
description: 'Responds with a Chuck Norris quote.',
|
|
args: [
|
|
{
|
|
key: 'name',
|
|
prompt: 'What would you like the name to be?',
|
|
type: 'string',
|
|
default: 'Chuck'
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
async run(msg, args) {
|
|
const { name } = args;
|
|
const { body } = await snekfetch
|
|
.get('http://api.icndb.com/jokes/random')
|
|
.query({
|
|
escape: 'javascript',
|
|
firstName: name
|
|
});
|
|
return msg.say(body.value.joke);
|
|
}
|
|
};
|