// code from goatstore // api: https://store.agi.bd module.exports = { config: { name: "autoreact", version: "2.1.0", author: "RAYHAN-SABBIR", role: 0, shortDescription: "AI auto react to all messages", category: "System", guide: { en: "autoreact on/off" } }, onStart: async function ({ api, event, args }) { global.autoreact = global.autoreact || new Map(); const threadID = event.threadID; if (args[0] === "off") { global.autoreact.set(threadID, false); return api.sendMessage("AutoReact Turned OFF", threadID, event.messageID); } else { global.autoreact.set(threadID, true); return api.sendMessage("AutoReact Turned ON", threadID, event.messageID); } }, handleEvent: async function ({ api, event }) { global.autoreact = global.autoreact || new Map(); const threadID = event.threadID; // শুধু মেসেজ এর ক্ষেত্রে কাজ করবে if (event.type!== "message") return; if (global.autoreact.get(threadID) === false) return; if (event.senderID === api.getCurrentUserID()) return; if (!event.body) return; const msg = event.body.toLowerCase(); let react = "like"; // AI লজিক - মেসেজ পড়ে বুঝে রিয়েক্ট if (msg.includes("haha") || msg.includes("lol") || msg.includes("funny") || msg.includes("😂")) { react = "haha"; } else if (msg.includes("sad") || msg.includes("cry") || msg.includes("rip") || msg.includes("😢")) { react = "sad"; } else if (msg.includes("angry") || msg.includes("gali") || msg.includes("mad") || msg.includes("😘")) { react = "angry"; } else if (msg.includes("wow") || msg.includes("amazing") || msg.includes("nice") || msg.includes("🤨")) { react = "wow"; } else if (msg.includes("love") || msg.includes("beautiful") || msg.includes("cute") || msg.includes("❤️")) { react = "love"; } else if (msg.includes("?")) { react = "like"; // প্রশ্ন করলে লাইক } api.setMessageReaction(react, event.messageID, (err) => { if(err) console.log("React Error:", err); }, true); } };