mmm / plugins /dog.js
ravenbs1's picture
Upload 140 files
046b271 verified
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}`);
}
});