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 FoxAnimals extends Command { constructor(client: CommandoClient) { super(client, { name: 'fox', aliases: [ 'randomfox', 'random-fox' ], group: 'animals', memberName: 'fox', description: 'Gives you a random fox.', examples: ['uwu!fox'], 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('randomfox.ca') .setColor(0xFFCC4D) .setImage(await (await axios.get('https://randomfox.ca/floof/')).data.image) return msg.say(emb) } catch (err) { console.log(err) return msg.reply('Woops, there was an error with the (https://randomfox.ca/) API. ' + emoji.random()) } } };