// code from goatstore // api: https://store.agi.bd const { commands } = global.GoatBot; module.exports = { config: { name: "help", version: "3.1.0", author: "ā€”ĶžšŹ€ÉŖį“į“‡Ģ", countDown: 3, role: 0, description: { en: "See all commands." }, category: "system", guide: { en: "{pn} [cmd]" } }, onStart: async function ({ api, event, message, args, role }) { api.setMessageReaction("šŸ”„", event.messageID, () => {}, true); const botName = global.GoatBot.config.nickNameBot || "ā€”ĶžšŒź«Ź€į“œźœ° 🫠🌸"; const prefix = global.GoatBot?.config?.prefix || "!"; const COMMAND_NOT_FOUND = (cmdName, pfx) => `šŸ” š‚šØš¦š¦ššš§š ššØš­ š…šØš®š§š\n└─ š‚šØš¦š¦ššš§š: "${cmdName}"\n└─ š”š¬šž: ${pfx}š”šžš„š©`; function getTextSafe(v) { if (!v) return ""; if (typeof v === "string") return v; if (typeof v === "object" && typeof v.en === "string") return v.en; return String(v); } function formatCategory(v) { let raw = getTextSafe(v) || "Uncategorized"; raw = raw.trim().toLowerCase(); return raw.replace(/[a-z]+/g, w => w.charAt(0).toUpperCase() + w.slice(1)); } function findCommand(s) { const name = String(s || "").toLowerCase(); for (const [, cmd] of commands) { if (!cmd?.config) continue; if (String(cmd.config.name).toLowerCase() === name) return cmd; const aliases = Array.isArray(cmd.config.aliases)? cmd.config.aliases : cmd.config.aliases? [cmd.config.aliases] : []; if (aliases.some(a => String(a).toLowerCase() === name)) return cmd; } return null; } function canUse(c) { if (!c?.config) return false; const need = typeof c.config.role === "number"? c.config.role : 0; return role >= need; } function cmdFont(text) { const map = { a:"šš",b:"š›",c:"šœ",d:"š",e:"šž",f:"šŸ",g:"š ",h:"š”",i:"š¢",j:"š£",k:"š¤",l:"š„",m:"š¦",n:"š§",o:"šØ",p:"š©",q:"šŖ",r:"š«",s:"š¬",t:"š­",u:"š®",v:"šÆ",w:"š°",x:"š±",y:"š²",z:"š³",A:"š€",B:"š",C:"š‚",D:"šƒ",E:"š„",F:"š…",G:"š†",H:"š‡",I:"šˆ",J:"š‰",K:"šŠ",L:"š‹",M:"šŒ",N:"š",O:"šŽ",P:"š",Q:"š",R:"š‘",S:"š’",T:"š“",U:"š”",V:"š•",W:"š–",X:"š—",Y:"š˜",Z:"š™",0:"šŸŽ",1:"šŸ",2:"šŸ",3:"šŸ‘",4:"šŸ’",5:"šŸ“",6:"šŸ”",7:"šŸ•",8:"šŸ–",9:"šŸ—" }; return text.split("").map(ch => map[ch] || ch).join(""); } function catFont(text) { const map = { a:"š™–",b:"š™—",c:"š™˜",d:"š™™",e:"š™š",f:"š™›",g:"š™œ",h:"š™",i:"š™ž",j:"š™Ÿ",k:"š™ ",l:"š™”",m:"š™¢",n:"š™£",o:"š™¤",p:"š™„",q:"š™¦",r:"š™§",s:"š™Ø",t:"š™©",u:"š™Ŗ",v:"š™«",w:"š™¬",x:"š™­",y:"š™®",z:"š™Æ",A:"š˜¼",B:"š˜½",C:"š˜¾",D:"š˜æ",E:"š™€",F:"š™",G:"š™‚",H:"š™ƒ",I:"š™„",J:"š™…",K:"š™†",L:"š™‡",M:"š™ˆ",N:"š™‰",O:"š™Š",P:"š™‹",Q:"š™Œ",R:"š™",S:"š™Ž",T:"š™",U:"š™",V:"š™‘",W:"š™’",X:"š™“",Y:"š™”",Z:"š™•" }; return text.split("").map(c => map[c] || c).join(""); } // DETAIL VIEW if (args.length > 0) { const command = findCommand(args[0]); if (!command ||!canUse(command)) { return message.reply(COMMAND_NOT_FOUND(args[0], prefix)); } const c = command.config; const aliases = Array.isArray(c.aliases) && c.aliases.length > 0? c.aliases.join(", ") : "None"; return message.reply( "╭━━━━━━━━━━━━━━━━━━━╮\n" + `ā–ø š—”š—®š—ŗš—² : ${cmdFont(c.name)}\n` + `ā–ø š—”š—¹š—¶š—®š˜€ : ${cmdFont(aliases)}\n` + `ā–ø š—”š˜‚š˜š—µš—¼š—æ : ${c.author}\n` + `ā–ø š—©š—²š—æš˜€š—¶š—¼š—» : ${c.version}\n` + `ā–ø š—–š—®š˜š—²š—“š—¼š—æš˜† : ${catFont(formatCategory(c.category))}\n` + `ā–ø š—„š—¼š—¹š—² : ${c.role?? 0}\n` + `ā–ø š——š—²š˜€š—° : ${getTextSafe(c.description)}\n` + `ā–ø š—šš˜‚š—¶š—±š—² : ${getTextSafe(c.guide)?.replace(/{pn}/g, prefix + c.name) || "N/A"}\n` + ` šŸ’Ž ${prefix}help — Menu\n` + "╰━━━━━━━━━━━━━━━━━━━╯" ); } // MENU VIEW const categories = {}; const allCommands = new Set(); for (const [, command] of commands) { if (!command?.config) continue; if (!canUse(command)) continue; const name = String(command.config.name || "").trim(); if (!name) continue; const catRaw = getTextSafe(command.config.category) || "Uncategorized"; const catKey = catRaw.trim().toLowerCase(); if (!categories[catKey]) categories[catKey] = []; if (!categories[catKey].includes(name)) categories[catKey].push(name); allCommands.add(name); } const catKeys = Object.keys(categories).sort((a, b) => a.localeCompare(b)); let menu = "╭━━━━━━━━━━━━━━━━━━━╮\n" + `ā–ø š—•š—¼š˜ : ${botName}\n` + `ā–ø š—§š—¼š˜š—®š—¹ : ${allCommands.size} Commands\n` + `ā–ø š—£š—æš—²š—³š—¶š˜… : ${prefix}\n` + "╭━━━━━━━━━━━━━━━╮\n"; for (const key of catKeys) { const list = [...new Set(categories[key])].sort((a, b) => a.localeCompare(b)); const catName = catFont(formatCategory(key)); menu += `ā”ƒ ⟨ ${catName} ⟩\n`; for (let i = 0; i < list.length; i += 2) { const first = cmdFont(list[i]); const second = list[i + 1]? cmdFont(list[i + 1]) : null; if (second) menu += `ā”ƒ ā–ø ${first} ā–ø ${second}\n`; else menu += `ā”ƒ ā–ø ${first}\n`; } menu += "ā”ƒā”„ā”„ā”„ā”„ā”„ā”„ā”„\n"; } menu += ` šŸ’Ž ${prefix}help — details\n` + "╰━━━━━━━━━━━━━━━━━━━╯"; return message.reply(menu); } };