blob: fc887ef82751ad456502647bc16f0bc5ba78dcb5 (
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 FoxAnimals extends Command {
public constructor() {
super('fox', {
aliases: ['fox'],
category: 'animals',
description: {
content: 'Gives you a random fox!',
usage: '',
examples: [
''
]
},
ratelimit: 3,
clientPermissions: ['EMBED_LINKS']
});
}
public async exec(msg: Message): Promise<Message> {
const animal = await Axios.get(`https://randomfox.ca/floof/`).catch(err => {
console.error(err);
msg.reply('Woops, there was an error with the (http://randomfox.ca/floof/) API.');
});
const embed = this.client.util.embed()
.setColor(colour)
.setAuthor('randomfox.ca')
//@ts-ignore
.setImage(animal.data.image);
return msg.channel.send(embed);
}
}
|