From 6896751e86d10698e437fbab35f5e8d290a000f0 Mon Sep 17 00:00:00 2001 From: murm Date: Sun, 19 Mar 2023 01:10:07 -0400 Subject: [PATCH] add categories for the help cmd to look for --- commands/general/help.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/commands/general/help.js b/commands/general/help.js index a4d257e..f985a6b 100644 --- a/commands/general/help.js +++ b/commands/general/help.js @@ -20,19 +20,28 @@ class HelpCommand extends Command { return { html: html } } if (help.categories[this.args[0].toLowerCase()]) { + html = `

mrmBot Help - ${htmlescape(this.args[0])}

` + for (const [command] of collections.commands) { + if (collections.info.get(command).category != this.args[0].toLowerCase()) continue; + const description = collections.info.get(command).description; + html = html + `` + } + html = html + "
CommandDescription
${command}${description}
" + return { html: html } } } - html = `

mrmBot Help

` - for (const [command] of collections.commands) { - const description = collections.info.get(command).description; - html = html + `` + const prefix = htmlescape(process.env.PREFIX); + html = `

mrmBot Help - Categories

CommandDescription
${command}${description}
` + for (const category of Object.keys(help.categories)) { + html = html + `` } html = html + "
CategoryCommand
${category}${prefix}help ${category}
" + return { html: html } // return { html: "

There are no mrmBot Docs Yet

In the meantime, please refer to https://esmbot.net/help.html" }; } - + static category = "general" static description = "Gets a list of commands"; static aliases = ["commands"]; static arguments = ["{command}"];