import { Command } from 'discord-akairo'; import { Message } from 'discord.js'; import Axios from 'axios'; export default class GitHubZenFun extends Command { public constructor() { super('githubzen', { aliases: ['githubzen', 'github-zen'], category: 'fun', description: { content: 'Gives you a random GitHub design philosophy.', usage: '', examples: [ '' ] }, ratelimit: 3 }); } public async exec(msg: Message): Promise { const text = await Axios.get('https://api.github.com/zen').catch(err => { console.error(err); return msg.reply('Woops, there was an error with the (http://api.github.com) API.'); }); //@ts-ignore return msg.reply(text.data); } }