// code from goatstore // api: https://store.agi.bd const axios = require("axios"); const mahmud = async () => { const base = await axios.get( "https://raw.githubusercontent.com/mahmudx7/HINATA/main/baseApiUrl.json" ); return base.data.mahmud; }; module.exports = { config: { name: "pairdp", aliases: ["animepdp"], version: "1.7", author: "MahMUD", countDown: 5, role: 0, category: "media", guide: "{p}animecdp" }, onStart: async function ({ message }) { const obfuscatedAuthor = String.fromCharCode(77, 97, 104, 77, 85, 68); if (module.exports.config.author !== obfuscatedAuthor) { return api.sendMessage("You are not authorized to change the author name.", event.threadID, event.messageID); } try { const apiBase = await mahmud(); const baseUrl = `${apiBase}/api/cdpvip2`; const getStream = async (url) => { const res = await axios({ url, method: "GET", responseType: "stream", headers: { "User-Agent": "Mozilla/5.0" } }); return res.data; }; const category = "anime"; const res = await axios.get(`${baseUrl}?category=${category}`); const groupImages = res.data?.group || []; if (!groupImages.length) return message.reply(`โš  No DP found in "${category}" category.`); const streamAttachments = []; for (const url of groupImages) { try { const stream = await getStream(url); streamAttachments.push(stream); } catch { console.warn(`โš  Failed to load image: ${url}`); } } if (!streamAttachments.length) return message.reply("โŒ All image URLs failed to load."); return message.reply({ body: `๐ŸŽ€ ๐‡๐ž๐ซ๐ž'๐ฌ ๐ฒ๐จ๐ฎ๐ซ ๐ซ๐š๐ง๐๐จ๐ฆ ๐š๐ง๐ข๐ฆ๐ž ๐œ๐๐ฉ ๐›๐š๐›๐ฒ.`, attachment: streamAttachments }); } catch (err) { console.error("Full error:", err.response?.data || err.message); return message.reply("๐Ÿฅนerror, contact Farhan"); } } };