// code from goatstore // api: https://store.agi.bd module.exports = { config: { name: "botactive", version: "1.1", author: "Hridoy", countDown: 5, role: 2, description: "Notify all groups when the bot starts", category: "System", guide: { en: "{pn}: manually resend the bot-active notice to all groups" } }, // ๐Ÿ”” Auto notify all groups when the bot starts onLoad: async function ({ api, threadsData }) { try { setTimeout(async () => { const allThreads = (await threadsData.getAll()).filter(t => t.isGroup); for (const thread of allThreads) { try { await api.sendMessage( "โ•ญโ”€โ”€ใ€Œ แดแดแดœ sแด›แด€แด›แดœs ใ€โ”€โ”€โ•ฎ\n\n" + " โ™ก ๐Œ๐™ดสœ๐„แด…๐ˆ ๐๐จ๐ฐ ๐€๐œ๐ญ๐ข๐ฏ๐ž โ™ก\n\n" + " ๐Ÿคก ๐“๐ฒ๐ฉ๐ž " + "โ€น .๐‡๐ž๐ฅ๐ฉ โ€บ" + " ๐ญ๐จ ๐ฌ๐ž๐ž ๐Ÿ’ฅ\n" + " ๐€๐ฅ๐ฅ ๐€๐ฏ๐š๐ข๐ฅ๐š๐›๐ฅ๐ž ๐‚๐จ๐ฆ๐ฆ๐š๐ง๐๐ฌ\n\n" + "โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ", thread.threadID ); } catch (err) { console.error(`[BOT ACTIVE] Failed to notify ${thread.threadID}:`, err?.message || err); } // Facebook rate limit เฆเฆกเฆผเฆพเฆคเง‡ await new Promise(resolve => setTimeout(resolve, 1000)); } console.log("[BOT ACTIVE] Message sent to all groups."); }, 5000); } catch (err) { console.error("[BOT ACTIVE ERROR]", err); } }, // ๐Ÿ” Manual trigger (admin only): resend the notice on demand onStart: async function ({ api, event, threadsData }) { const allThreads = (await threadsData.getAll()).filter(t => t.isGroup); for (const thread of allThreads) { try { await api.sendMessage( "โ•ญโ”€โ”€โ”€ใ€Œ ๐๐Ž๐“ ๐’๐“๐€๐“๐”๐’ ใ€โ”€โ”€โ”€โ•ฎ\n\n" + " ๐Ÿค– ๐‘ฉ๐’๐’• ๐’Š๐’” ๐’๐’๐’˜ ๐‘จ๐’„๐’•๐’Š๐’—๐’† โœ…\n\n" + " ๐Ÿ“– ๐‘ป๐’š๐’‘๐’† " + "โ€น .help โ€บ" + " ๐’•๐’ ๐’”๐’†๐’†\n" + " ๐’‚๐’๐’ ๐’‚๐’—๐’‚๐’Š๐’๐’‚๐’ƒ๐’๐’† ๐’„๐’๐’Ž๐’Ž๐’‚๐’๐’…๐’”\n\n" + "โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ", thread.threadID ); } catch (err) { console.error(`[BOT ACTIVE] Failed to notify ${thread.threadID}:`, err?.message || err); } await new Promise(resolve => setTimeout(resolve, 1000)); } return api.sendMessage(`โœจ ๐‘ต๐’๐’•๐’Š๐’‡๐’Š๐’†๐’… ${allThreads.length} ๐’ˆ๐’“๐’๐’–๐’‘(๐’”) โœ…`, event.threadID); } };