// code from goatstore // api: https://store.agi.bd module.exports = { config: { name: "antiname", version: "1.0.0", role: 1, author: "ROBIUL", description: "Prevents group name changes by unauthorized users", category: "admin", guide: "{pn} on/off", countDown: 5 }, onStart: async function ({ api, event, args, threadsData }) { const { threadID } = event; const mode = args[0]?.toLowerCase(); if (mode === "on") { const threadInfo = await api.getThreadInfo(threadID); await threadsData.set(threadID, threadInfo.threadName, "data.antiname"); return api.sendMessage("✅ Anti-Name Change enabled. Only authorized users can change the group name.", threadID); } else if (mode === "off") { await threadsData.set(threadID, null, "data.antiname"); return api.sendMessage("❌ Anti-Name Change disabled.", threadID); } else { return api.sendMessage("Usage: {prefix}antiname on/off", threadID); } }, onEvent: async function ({ api, event, threadsData }) { const { threadID, logMessageType, author } = event; if (logMessageType === "log:thread-name") { const savedName = await threadsData.get(threadID, "data.antiname"); const botID = api.getCurrentUserID(); // Replace with your actual Facebook UID const adminID = "YOUR_FACEBOOK_ID_HERE"; if (savedName && author !== botID && author !== adminID) { api.setTitle(savedName, threadID, () => { api.sendMessage("⚠️ Warning: You are not authorized to change the group name!", threadID); }); } } } };