diff options
Diffstat (limited to 'server/src/commands/animals/Cat.ts')
| -rw-r--r-- | server/src/commands/animals/Cat.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/server/src/commands/animals/Cat.ts b/server/src/commands/animals/Cat.ts new file mode 100644 index 0000000..8c37d2c --- /dev/null +++ b/server/src/commands/animals/Cat.ts @@ -0,0 +1,36 @@ +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<Message> { + 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); + } +}
\ No newline at end of file |