// code from goatstore // api: https://store.agi.bd const axios = require("axios"); const baseApiUrl = async () => { try { const base = await axios.get("https://raw.githubusercontent.com/mahmudx7/HINATA/main/baseApiUrl.json"); return base.data.mahmud; } catch { return "https://hinata-api.vercel.app"; } }; module.exports = { config: { name: "bby", aliases: ["baby", "babu", "jan", "bot"], version: "2.0-clean", author: "RAYHAN-SABBIR", countDown: 0, role: 0, description: "Clean talk only - no font spam", category: "chat", guide: { en: "{pn} hi - কথা বলো\n{pn} teach hi - hello - শেখাও\n{pn} list - লিস্ট দেখো" } }, onStart: async function ({ api, event, args, message }) { const uid = event.senderID; const baseUrl = await baseApiUrl(); try { if (!args[0]) { return message.reply("বলো জান, শুনছি 🖤"); } const cmd = args[0].toLowerCase(); // শেখানো if (cmd === "teach") { const full = args.slice(1).join(" "); const [trigger, responses] = full.split(" - "); if (!trigger ||!responses) { return message.reply("⚠️ নিয়ম: bby teach প্রশ্ন - উত্তর"); } const res = await axios.post(`${baseUrl}/api/jan/teach`, { trigger: trigger.trim(), responses: responses.trim(), userID: uid }); return message.reply(`✅ শিখে গেছি: "${trigger}" → "${responses}"`); } // লিস্ট if (cmd === "list") { const res = await axios.get(`${baseUrl}/api/jan/list`); return message.reply(res.data.message || "কোনো ডাটা নাই"); } // রিমুভ if (cmd === "remove" || cmd === "rm") { const full = args.slice(1).join(" "); const [trigger, index] = full.split(" - "); if (!trigger ||!index) return message.reply("⚠️ নিয়ম: bby remove প্রশ্ন - index"); const res = await axios.delete(`${baseUrl}/api/jan/remove`, { data: { trigger, index: parseInt(index) } }); return message.reply(res.data.message); } // নরমাল কথা const text = args.join(" "); const res = await axios.post(`${baseUrl}/api/hinata`, { text: text, style: 1 }); return message.reply(res.data.message); } catch (e) { return message.reply("একটু পরে বলো জান, API বিজি 🥺"); } }, onChat: async function ({ api, event }) { try { const body = event.body?.toLowerCase(); if (!body) return; // শুধু bby / baby / bot দিয়ে শুরু করলে রিপ্লাই দিবে, always active না const triggers = ["bby", "baby", "babu", "jan", "bot"]; const starts = triggers.some(t => body.startsWith(t)); if (!starts) return; const baseUrl = await baseApiUrl(); let userText = event.body; // prefix বাদ দাও for (const t of triggers) { if (body.startsWith(t)) { userText = event.body.substring(t.length).trim(); break; } } if (!userText) { userText = "hi"; } api.sendTypingIndicator(event.threadID); const res = await axios.post(`${baseUrl}/api/hinata`, { text: userText, style: 1 }); let reply = res.data.message; // ফালতু প্রমোশন লেখা থাকলে কেটে ফেলা if (reply) { reply = reply.replace(/100\+ font.*$/i, "").trim(); reply = reply.replace(/0% 18\+.*$/i, "").trim(); reply = reply.replace(/always active.*$/i, "").trim(); } return api.sendMessage(reply, event.threadID, (err, info) => { if (!err && global.GoatBot?.onReply) { global.GoatBot.onReply.set(info.messageID, { commandName: "bby", messageID: info.messageID, author: event.senderID }); } }, event.messageID); } catch (e) { console.log(e.message); } }, onReply: async function ({ api, event }) { try { const baseUrl = await baseApiUrl(); const res = await axios.post(`${baseUrl}/api/hinata`, { text: event.body || "hi", style: 1 }); return api.sendMessage(res.data.message, event.threadID, (err, info) => { if (!err && global.GoatBot?.onReply) { global.GoatBot.onReply.set(info.messageID, { commandName: "bby", messageID: info.messageID, author: event.senderID }); } }, event.messageID); } catch {} } };