// code from goatstore // api: https://store.agi.bd const { getPrefix } = global.utils; const { commands, aliases } = global.GoatBot; // ๐€๐›๐œ๐ เฆธเงเฆŸเฆพเฆ‡เฆฒ เฆซเฆจเงเฆŸ เฆ•เฆจเฆญเฆพเฆฐเงเฆŸเฆพเฆฐ function toBoldFont(text) { const boldMap = { '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(c => boldMap[c] || c).join(''); } module.exports = { config: Object.freeze({ name: "help", version: "2.0", author: "โœฆ ๐—ฆ๐—›๐—”๐—ก๐—ง๐—ข โœฆ", countDown: 5, role: 0, shortDescription: { en: "๐Ÿ“– View command usage" }, longDescription: { en: "๐Ÿ“œ View command usage and list all commands" }, category: "system", guide: { en: "โœฆ {pn} [command] | {pn} -a [author] | {pn} -c [category]" }, priority: 1, }), onStart: async function ({ message, args, event, role, api }) { const { threadID, messageID } = event; const prefix = getPrefix(threadID); if (!global.helpMessageIDs) global.helpMessageIDs = {}; if (!global.helpMessageIDs[threadID]) global.helpMessageIDs[threadID] = []; // เฆชเงเฆฐเฆพเฆจเง‹ เฆฎเง‡เฆธเง‡เฆœ เฆกเฆฟเฆฒเฆฟเฆŸ const previousMessages = global.helpMessageIDs[threadID] || []; for (const msgID of previousMessages) { try { await api.unsendMessage(msgID); } catch (e) {} } global.helpMessageIDs[threadID] = []; let filterAuthor = null; let filterCategory = null; // Filter เฆนเงเฆฏเฆพเฆจเงเฆกเฆฒเฆฟเฆ‚ if (args[0] === "-a" && args[1]) { filterAuthor = args.slice(1).join(" ").toLowerCase(); } else if (args[0] === "-c" && args[1]) { filterCategory = args.slice(1).join(" ").toLowerCase(); } else if (args.length > 0 && !args[0].startsWith("-")) { // เฆจเฆฟเฆฐเงเฆฆเฆฟเฆทเงเฆŸ เฆ•เฆฎเฆพเฆจเงเฆกเง‡เฆฐ help const commandName = args[0].toLowerCase(); const command = commands.get(commandName) || commands.get(aliases.get(commandName)); if (!command) return message.reply(`โŒ Command "${commandName}" not found.`); const configCommand = command.config; const roleText = roleTextToString(configCommand.role); const usage = (configCommand.guide?.en || "No guide available.") .replace(/{pn}/g, prefix) .replace(/{n}/g, configCommand.name); const replyMsg = await message.reply( `โ•ญโ”€โ”€ใ€Œ ๐—–๐—ข๐— ๐— ๐—”๐—ก๐—— ๐—›๐—˜๐—Ÿ๐—ฃ ใ€โ”€โ”€โฆฟ โ”ƒ โœฆ ๐—ก๐—ฎ๐—บ๐—ฒ: ${configCommand.name} โ”ƒ โœฆ ๐——๐—ฒ๐˜€๐—ฐ: ${configCommand.longDescription?.en || "No description"} โ”ƒ โœฆ ๐—”๐—น๐—ถ๐—ฎ๐˜€๐—ฒ๐˜€: ${configCommand.aliases?.join(", ") || "None"} โ”ƒ โœฆ ๐—ฉ๐—ฒ๐—ฟ๐˜€๐—ถ๐—ผ๐—ป: ${configCommand.version || "1.0"} โ”ƒ โœฆ ๐—ฅ๐—ผ๐—น๐—ฒ: ${roleText} โ”ƒ โœฆ ๐—–๐—ผ๐—ผ๐—น๐—ฑ๐—ผ๐˜„๐—ป: ${configCommand.countDown || 1}s โ”ƒ โœฆ ๐—”๐˜‚๐˜๐—ต๐—ผ๐—ฟ: ${configCommand.author || "Unknown"} โ”ƒ โœฆ ๐—จ๐˜€๐—ฎ๐—ด๐—ฒ: ${usage} โ•ฐโ”€โ”€โ”€โ”€ใ€Œ ๐—ฃ๐—ข๐—–๐—ž๐—˜ ใ€โ”€โ”€โ”€โฆฟ` ); global.helpMessageIDs[threadID].push(replyMsg.messageID); return; } // เฆธเฆฌ เฆ•เฆฎเฆพเฆจเงเฆก เฆธเฆ‚เฆ—เงเฆฐเฆน const allCommands = []; let total = 0; for (const [name, value] of commands) { const config = value.config; if (filterAuthor && (!config.author || !config.author.toLowerCase().includes(filterAuthor))) continue; if (filterCategory && (!config.category || !config.category.toLowerCase().includes(filterCategory))) continue; allCommands.push({ name, category: config.category || "Uncategorized", role: config.role || 0 }); total++; } if (total === 0) { const filterMsg = filterAuthor ? `author "${filterAuthor}"` : `category "${filterCategory}"`; return message.reply(`โŒ No commands found for ${filterMsg}.`); } // Sort by category allCommands.sort((a, b) => { if (a.category === b.category) return a.name.localeCompare(b.name); return a.category.localeCompare(b.category); }); // Category เฆญเฆพเฆ— เฆ•เฆฐเฆพ const categories = {}; for (const cmd of allCommands) { if (!categories[cmd.category]) categories[cmd.category] = []; categories[cmd.category].push({ name: cmd.name, role: cmd.role }); } // ๐Ÿ”ฅ Premium Header let msg = `โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—\n`; msg += `โ•‘ โœฆ ๐—ฃ๐—ข๐—–๐—ž๐—˜ ๐—•๐—ข๐—ง ๐—›๐—˜๐—Ÿ๐—ฃ โœฆ โ•‘\n`; msg += `โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\n\n`; msg += `โ•ญโ”โ”โ” ๐Ÿ“Š ๐—ฆ๐—ง๐—”๐—ง๐—œ๐—ฆ๐—ง๐—œ๐—–๐—ฆ โ”โ”โ”โ•ฎ\n`; msg += `โ”ƒ โœฆ ๐Ÿ“ฆ Total Commands: ${total}\n`; msg += `โ”ƒ โœฆ ๐Ÿ“‚ Total Categories: ${Object.keys(categories).length}\n`; msg += `โ”ƒ โœฆ ๐Ÿ”ฐ Prefix: ${prefix}\n`; msg += `โ•ฐโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•ฏ\n\n`; // เฆธเฆฌ เฆ•เฆฎเฆพเฆจเงเฆก เฆฆเง‡เฆ–เฆพเฆจเง‹ (เฆเฆ•เฆธเฆพเฆฅเง‡) for (const category of Object.keys(categories).sort()) { const categoryCommands = categories[category]; // Category Header msg += `โ•ญโ”€โ”€ใ€Œ ๐Ÿ“‚ ${toBoldFont(category.toUpperCase())} ใ€โ”€โ”€โฆฟ\n`; for (const cmd of categoryCommands) { const roleIndicator = cmd.role > 0 ? " ๐Ÿ”’" : " "; msg += `โ”ƒ โœฆ โš™ ${toBoldFont(cmd.name)}${roleIndicator}\n`; } msg += `โ•ฐโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•ฏ\n\n`; } // Footer msg += `โ•ญโ”โ”โ” โ„น ๐—œ๐—ก๐—™๐—ข โ”โ”โ”โ•ฎ\n`; msg += `โ”ƒ โœฆ ๐Ÿ”’ = Admin Only\n`; msg += `โ”ƒ โœฆ โœฆ Use: ${prefix}help [cmd]\n`; msg += `โ”ƒ โœฆ โœฆ Owner: ๐—ฆ๐—›๐—”๐—ก๐—ง๐—ข\n`; msg += `โ•ฐโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•ฏ\n\n`; msg += `โœฆ โ”โ”โ”โ”โ” ๐—ฃ๐—ข๐—–๐—ž๐—˜ ๐—•๐—ข๐—ง โ”โ”โ”โ”โ” โœฆ`; const replyMsg = await message.reply(msg); global.helpMessageIDs[threadID].push(replyMsg.messageID); }, }; function roleTextToString(role) { switch (role) { case 0: return "๐Ÿ‘ฅ All Users"; case 1: return "๐Ÿ‘‘ Group Admins"; case 2: return "๐Ÿค– Bot Admins"; default: return "๐Ÿ”’ Unknown Role"; } }