File size: 1,795 Bytes
046b271 |
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 37 38 39 40 41 42 43 44 45 46 |
const axios = require('axios');
const { cmd, commands } = require('../command');
cmd({
pattern: "dog",
desc: "Fetch a random dog image.",
category: "fun",
react: "🐶",
filename: __filename
},
async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => {
try {
const apiUrl = `https://dog.ceo/api/breeds/image/random`;
const response = await axios.get(apiUrl);
const data = response.data;
await conn.sendMessage(from, { image: { url: data.message }, caption: 'ALI-MD-V1 DOWNLOAD DOG 🐕 PICS\n\n\n> *🐕BY ALI TECH🐕*' }, { quoted: mek });
} catch (e) {
console.log(e);
reply(`Error Fetching Dog Image🤕: ${e.message}`);
}
});
cmd({
pattern: "cat",
desc: "Fetch a random cat image.",
category: "fun",
react: "🐱",
filename: __filename
},
async (conn, mek, m, { from, quoted, body, isCmd, command, args, q, isGroup, sender, senderNumber, botNumber2, botNumber, pushname, isMe, isOwner, groupMetadata, groupName, participants, groupAdmins, isBotAdmins, isAdmins, reply }) => {
try {
// API URL to fetch a random cat image
const apiUrl = `https://api.thecatapi.com/v1/images/search`;
const response = await axios.get(apiUrl);
const data = response.data;
// Send the cat image with a caption
await conn.sendMessage(from, { image: { url: data[0].url }, caption: 'ALI-MD-V1 DOWNLOAD CAT 🐈 PICS\n\n> *🐈BY ALI TECH🐈*' }, { quoted: mek });
} catch (e) {
console.log(e);
reply(`Error Fetching Cat Image 🤕: ${e.message}`);
}
});
|