// code from goatstore // api: https://store.agi.bd const { getPrefix } = global.utils; const { commands } = global.GoatBot; module.exports = { config: { name: "help", version: "3.5", author: "Mostakim", usePrefix: false, role: 0, category: "info", priority: 1 }, onStart: async function ({ message, args, event, threadsData, role }) { const prefix = getPrefix(event.threadID); const arg = args[0]?.toLowerCase(); const header = "ā•”ā•ā”ć€Œ š‡š„š‹š šŒš„šš” ć€ā”ā•ā•—"; const footer = "ā•šā•ā”ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”ā•ā•"; if (!arg) { const list = Array.from(commands.entries()) .filter(([_, cmd]) => cmd.config?.role <= role) .map(([name]) => `ā”ƒ ✦ ${name}`) .join("\n"); return message.reply( `${header}\n` + `ā”ƒ šŸ”‘ Prefix: ${prefix}\n` + `ā”ƒ šŸ“‚ Total Commands: ${commands.size}\n` + `ā”ƒ āš™ļø Available Commands:\n` + `${list}\n` + `${footer}\n` + `\nšŸ“Œ Use \`${prefix}help -\` to filter by category\n` + `šŸ“Œ Use \`${prefix}help \` to see command info` ); } if (arg === "-c" && args[1]) { const cmdName = args[1].toLowerCase(); const cmd = commands.get(cmdName) || commands.get(global.GoatBot.aliases.get(cmdName)); if (!cmd || cmd.config.role > role) return message.reply(`✘ Command "${cmdName}" not found or access denied.`); return message.reply( `${header}\n` + `ā”ƒ ✦ Command: ${cmdName}\n` + `ā”ƒ ✦ Category: ${cmd.config.category || "Uncategorized"}\n` + `${footer}` ); } if (arg.startsWith("-")) { const category = arg.slice(1).toLowerCase(); const matched = Array.from(commands.entries()) .filter(([_, cmd]) => cmd.config?.category?.toLowerCase() === category && cmd.config.role <= role) .map(([name]) => `ā”ƒ ✦ ${name}`); if (matched.length === 0) return message.reply(`✘ No commands found under "${category}".`); return message.reply( `ā•”ā•ā”ć€Œ š‚š€š“š„š†šŽš‘š˜: ${category.toUpperCase()} ć€ā”ā•ā•—\n` + `${matched.join("\n")}\n` + `${footer}\n` + `\nšŸ“Œ Try: \`${prefix}help \` to view details` ); } const cmd = commands.get(arg) || commands.get(global.GoatBot.aliases.get(arg)); if (!cmd || cmd.config.role > role) return message.reply(`✘ Command "${arg}" not found.`); const info = cmd.config; const guide = info.guide?.en || "No usage info."; const desc = info.longDescription?.en || "No description."; return message.reply( `ā•”ā•ā”ć€Œ š‚šŽšŒšŒš€ššƒ šƒš„š“š€šˆš‹š’ ć€ā”ā•ā•—\n` + `ā”ƒ ✦ Name: ${info.name}\n` + `ā”ƒ ✦ Description: ${desc}\n` + `ā”ƒ ✦ Usage: ${guide.replace(/{p}/g, prefix).replace(/{n}/g, info.name)}\n` + `ā”ƒ ✦ Role: ${info.role}\n` + `ā”ƒ ✦ Category: ${info.category || "Uncategorized"}\n` + `${footer}` ); } };