// code from goatstore // api: https://store.agi.bd module.exports = { config: { name: "notification", version: "3.0", author: "—͞𝐏ʀɪᴍᴇ́", countDown: 10, role: 2, shortDescription: "Send notification to all groups", longDescription: "Send notification to all groups", category: "admin", guide: "{pn} ", aliases: ["noti"] }, onStart: async function ({ api, event, args }) { const { threadID, messageID, senderID } = event; const text = args.join(" "); if (!text) return api.sendMessage("❌ 𝗨𝘀𝗲: {pn} ", threadID, messageID); try { const info = await api.getUserInfo(senderID); const senderName = info[senderID]?.name || "𝗔𝗱𝗺𝗶𝗻"; const time = new Date().toLocaleString("en-BD", { timeZone: "Asia/Dhaka", hour12: true }); const allThreads = await api.getThreadList(100, null, ["INBOX"]); const groupThreads = allThreads.filter(t => t.isGroup); await api.sendMessage(`🚀 𝗦𝗲𝗻𝗱𝗶𝗻𝗴 𝘁𝗼 ${groupThreads.length} 𝗴𝗿𝗼𝘂𝗽𝘀...`, threadID, messageID); const msg = `━━━━━━━━━━━━━━━━━━━━━ 👑 𝐀𝐃𝐌𝐈𝐍 𝐍𝐎𝐓𝐈𝐅𝐈𝐂𝐀𝐓𝐈𝐎𝐍 👑 ━━━━━━━━━━━━━━━━━━━━━ 👤 𝗙𝗿𝗼𝗺: ${senderName} ⏰ 𝗧𝗶𝗺𝗲: ${time} ━━━━━━━━━━━━━━━━━━━━━ 💌 𝗠𝗲𝘀𝘀𝗮𝗴𝗲: ${text} ━━━━━━━━━━━━━━━━━━━━━`; let success = 0; for (const thread of groupThreads) { try { await api.sendMessage(msg, thread.threadID); success++; await new Promise(r => setTimeout(r, 700)); } catch {} } return api.sendMessage( `━━━━━━━━━━━━━━━━━━━━━ ✅ 𝗦𝗲𝗻𝘁: ${success}/${groupThreads.length} 𝗚𝗿𝗼𝘂𝗽𝘀 ━━━━━━━━━━━━━━━━━━━━━`, threadID, messageID); } catch (e) { return api.sendMessage(`❌ 𝗙𝗮𝗶𝗹𝗲𝗱: ${e.message}`, threadID, messageID); } } };