/[sudobot]/trunk/commands/cat.js
ViewVC logotype

Annotation of /trunk/commands/cat.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (hide annotations)
Mon Jul 29 17:28:11 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: text/javascript
File size: 708 byte(s)
Added base commands
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://api.thecatapi.com/v1/images/search")
7     .then(res => {
8     if (res && res.status === 200) {
9     msg.reply({
10     content: res.data[0].url
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     };

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26