blob: 8c37d2cd4f3a5d458efbd00f081bd0faddba7ce8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);
}
}
|