mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
Chuck Norris Jokes
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user