// code from goatstore // api: https://store.agi.bd const axios = require("axios"); const fs = require("fs"); const path = require("path"); module.exports = { config: { name: "allnoti", version: "3.0", author: "π’πˆπ˜π€πŒ-𝐇𝐀𝐒𝐀𝐍", role: 2, shortDescription: "Owner Broadcast", longDescription: "Send notification with owner name", category: "admin", guide: "{pn} " }, onStart: async function ({ api, event, args }) { const msg = args.join(" "); if (!msg) return api.sendMessage("⚠️ Message dao!", event.threadID); let attachment = null; // Reply image support if (event.messageReply && event.messageReply.attachments.length > 0) { const url = event.messageReply.attachments[0].url; const filePath = path.join(__dirname, "cache", "owner.jpg"); const res = await axios.get(url, { responseType: "arraybuffer" }); fs.writeFileSync(filePath, res.data); attachment = fs.createReadStream(filePath); } const threads = await api.getThreadList(100, null, ["INBOX"]); let success = 0; let failed = 0; for (const thread of threads) { if (thread.isGroup) { try { await new Promise(resolve => setTimeout(resolve, 1500)); await api.sendMessage( { body: `πŸ”” π™‰π™Šπ™π™„π™π™„π˜Ύπ˜Όπ™π™„π™Šπ™‰\n━━━━━━━━━━━━━━━\nπŸ“’ From Owner:π“†©πŸ‘‘-π’πˆπ˜π€πŒ-πŸ‘‘π“†ͺ\n\n${msg}\n━━━━━━━━━━━━━━━`, attachment: attachment }, thread.threadID ); success++; } catch (e) { failed++; } } } api.sendMessage( `βœ… Done Owner Broadcast\nβœ”οΈ Success: ${success}\n❌ Failed: ${failed}`, event.threadID ); } };