import { Command } from 'discord-akairo'; import { Message } from 'discord.js'; import Axios from 'axios'; import { colour } from '../../Config'; export default class CatAnimals extends Command { public constructor() { super('cat', { aliases: ['cat'], category: 'animals', description: { content: 'Gives you a random cat!', usage: '', examples: [ '' ] }, ratelimit: 3, clientPermissions: ['EMBED_LINKS'] }); } public async exec(msg: Message): Promise { const animal = await Axios.get(`https://aws.random.cat/meow`).catch(err => { console.error(err); msg.reply('Woops, there was an error with the (http://random.cat/) API.'); }); const embed = this.client.util.embed() .setColor(colour) .setAuthor('bunnies.io', 'https://i.imgur.com/Ik0Gf0r.png', 'https://random.cat') //@ts-ignore .setImage(animal.data.file); return msg.channel.send(embed); } }