// code from goatstore // api: https://store.agi.bd const fs = require("fs") const path = require("path") const FILE_PATH = path.join(__dirname, "sad_caption.txt") let captions = [] if(fs.existsSync(FILE_PATH)){ let data = fs.readFileSync(FILE_PATH, "utf-8") captions = data.split("\n").filter(line => line.trim() != "") } module.exports = { config: { name: "autocaption", version: "1.0.6", role: 0, author: "RAYHAN", description: "Auto sad caption reply", category: "fun", usages: "caption / kosto / sad", cooldowns: 2 }, onStart: async function({ api, message, event }) { return message.reply("✅ Auto Caption ON\nকেউ কষ্ট caption লিখলে আমি অটো রিপ্লাই দিবো 💔") }, onChat: async function({ api, message, event }) { const { threadID, body } = event if(!body) return const msg = body.toLowerCase() const keywords = ["caption", "kosto", "sad", "bhalobasha", "broken", "dukkho", "একা", "কষ্ট", "ক্যাপশন", "ভালোবাসা"] const found = keywords.some(word => msg.includes(word)) if(found){ if(captions.length == 0) return message.reply("⚠️ sad_caption.txt file khali") const randomCap = captions[Math.floor(Math.random() * captions.length)] return message.reply(randomCap) } } }