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