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