mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 15:57:50 +02:00
Split random response and random image, Lando Command
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class GithubZenCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'github-zen',
|
||||
aliases: ['gh-zen'],
|
||||
group: 'random-res',
|
||||
memberName: 'github-zen',
|
||||
description: 'Responds with a random GitHub design philosophy.',
|
||||
credit: [
|
||||
{
|
||||
name: 'GitHub',
|
||||
url: 'https://github.com/',
|
||||
reason: 'Zen API',
|
||||
reasonURL: 'https://developer.github.com/v3/'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
try {
|
||||
const { text } = await request.get('https://api.github.com/zen');
|
||||
return msg.say(text);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user