// code from goatstore // api: https://store.agi.bd const { getPrefix } = global.utils; const { commands, aliases } = global.GoatBot; module.exports = { config: { name: "help", version: "2.0", author: "KAI⚡", countDown: 5, role: 0, description: { en: "View aesthetic help menu with bot info" }, category: "info", guide: { en: "{pn} [page number | command name]" } }, onStart: async function ({ message, args, event, role }) { // ────────── CUSTOMIZE HERE ────────── const BOT_NAME = global.GoatBot.config.nickNameBot || "GoatBot"; const OWNER_NAME = "ISHIGAMI"; // ──────────────────────────────────── const prefix = getPrefix(event.threadID); const page = parseInt(args[0]) || 1; const numberOfOnePage = 15; // Get all usable commands let allCommands = []; for (const [name, cmd] of commands) { if (cmd.config.role > 1 && role < cmd.config.role) continue; allCommands.push(name); } allCommands.sort(); const totalPages = Math.ceil(allCommands.length / numberOfOnePage) || 1; if (page < 1 || page > totalPages) { return message.reply(`❌ Page ${page} does not exist.\nTotal pages: ${totalPages}`); } // If user typed a command name const commandName = (args[0] || "").toLowerCase(); let command = commands.get(commandName) || commands.get(aliases.get(commandName)); if (command && isNaN(args[0])) { const config = command.config; const roleText = config.role === 0 ? "Everyone" : config.role === 1 ? "Group Admin" : "Bot Admin"; const infoMsg = `╭───✦ COMMAND INFO ✦───╮ │ │ 📌 Name : ${config.name} │ 📝 Version : ${config.version || "1.0"} │ 👤 Author : ${config.author || "Unknown"} │ 🛡️ Role : ${roleText} │ 📂 Category : ${config.category || "General"} │ │ 📖 Description: │ ${config.description?.en || config.description || "No description"} │ │ 💡 Guide: │ ${(config.guide?.en || config.guide || "No guide").replace(/{pn}/g, prefix + config.name).replace(/{p}/g, prefix).replace(/{n}/g, config.name)} │ ╰─────────────────────╯`; return message.reply(infoMsg); } // Normal help menu const start = (page - 1) * numberOfOnePage; const end = start + numberOfOnePage; const pageCommands = allCommands.slice(start, end); let commandList = pageCommands.map((cmd, i) => `│ ${start + i + 1}. ${cmd}`).join("\n"); const helpMsg = `╔══════════✦══════════╗ ║ ✦ ${BOT_NAME.toUpperCase()} HELP MENU ✦ ╚══════════✦══════════╝ ╭─ 🤖 BOT INFORMATION │ • Name : ${BOT_NAME} │ • Prefix : [ ${prefix} ] │ • Owner : ${OWNER_NAME} │ • Commands : ${allCommands.length} ╰───────────────────── ╭─ 📜 COMMAND LIST (Page \( {page}/ \){totalPages}) ${commandList || "│ No commands found"} ╰───────────────────── ╭─ 💡 HOW TO USE │ • ${prefix}help │ • ${prefix}help │ Example: ${prefix}help 2 │ Example: ${prefix}help ping ╰───────────────────── ✦ Developed with ❤️ by ${OWNER_NAME} ✦ Author: KAI⚡`; return message.reply(helpMsg); } };