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