import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; //@ts-ignore no types import emoji from 'emoji-random' import { MessageEmbed } from 'discord.js'; import axios from 'axios'; module.exports = class OwlAnimals extends Command { constructor(client: CommandoClient) { super(client, { name: 'owl', aliases: [ 'randomowl', 'random-owl' ], group: 'animals', memberName: 'owl', description: 'Gives you a random owl.', examples: ['uwu!owl'], throttling: { usages: 5, duration: 30 }, userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] }); } async run(msg: CommandoMessage) { try { let emb = new MessageEmbed() .setAuthor('pics.floofybot.moe/owl', 'http://pics.floofybot.moe/assets/favicon.svg', 'http://pics.floofybot.moe/') .setColor(0xFFCC4D) .setImage(await (await axios.get('http://pics.floofybot.moe/owl')).data.image) return msg.say(emb) } catch (err) { console.log(err) return msg.reply('Woops, there was an error with the (http://pics.floofybot.moe/) API. ' + emoji.random()) } } };