1 |
rakin |
5 |
const MessageEmbed = require("../src/MessageEmbed"); |
2 |
|
|
const axios = require('axios').default; |
3 |
|
|
|
4 |
|
|
module.exports = { |
5 |
|
|
async handle(msg, cm) { |
6 |
|
|
axios.get("https://dog.ceo/api/breeds/image/random") |
7 |
|
|
.then(res => { |
8 |
|
|
if (res && res.status === 200 && res.data.status === 'success') { |
9 |
|
|
msg.reply({ |
10 |
|
|
content: res.data.message |
11 |
|
|
}); |
12 |
|
|
} |
13 |
|
|
}) |
14 |
|
|
.catch(err => { |
15 |
|
|
msg.reply({ |
16 |
|
|
embeds: [ |
17 |
|
|
new MessageEmbed() |
18 |
|
|
.setColor('#f14a60') |
19 |
|
|
.setDescription('Too many requests at the same time, please try again after some time.') |
20 |
|
|
] |
21 |
|
|
}); |
22 |
|
|
}); |
23 |
|
|
} |
24 |
|
|
}; |