import { Command } from 'discord-akairo'; import { Message } from 'discord.js'; import Axios from 'axios'; export default class YoMommaFun extends Command { public constructor() { super('yomomma', { aliases: ['yomomma', 'yo-momma'], category: 'fun', description: { content: 'Grabs a "Yo Momma" joke.', usage: '', examples: [ '' ] }, ratelimit: 3 }); } public async exec(msg: Message): Promise { const fact = await Axios.get('https://api.yomomma.info/').catch(err => { console.error(err); return msg.reply('Woops, there was an error with the (https://api.yomomma.info/) API.'); }); //@ts-ignore return msg.reply(fact.data.joke); } }