From cc9f1575c71d544ee14a72579fb5b90dc81f104e Mon Sep 17 00:00:00 2001 From: Tom <54591857+SignalManSteve@users.noreply.github.com> Date: Thu, 27 Jun 2024 07:10:41 +0100 Subject: [PATCH] Update help.lua --- Cmdr/BuiltInCommands/help.lua | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/Cmdr/BuiltInCommands/help.lua b/Cmdr/BuiltInCommands/help.lua index e63af67d..1193c434 100644 --- a/Cmdr/BuiltInCommands/help.lua +++ b/Cmdr/BuiltInCommands/help.lua @@ -17,7 +17,6 @@ Tips return { Name = "help", - Aliases = { "cmds", "commands" }, Description = "Displays a list of all commands, or inspects one command.", Group = "Help", Args = { @@ -36,22 +35,17 @@ return { if command.Aliases and #command.Aliases > 0 then context:Reply(`Aliases: {table.concat(command.Aliases, ", ")}`, Color3.fromRGB(230, 230, 230)) end - if command.Description then - context:Reply(`Description: {command.Description}`, Color3.fromRGB(230, 230, 230)) - end - if command.Group then - context:Reply(`Group: {command.Group}`, Color3.fromRGB(230, 230, 230)) - end - if command.Args then - for i, arg in ipairs(command.Args) do - if type(arg) == "function" then - arg = arg(context) - end - - context:Reply( - `{arg.Name}{if arg.Optional == true then "?" else ""}: {arg.Type} - {arg.Description}` - ) + context:Reply(command.Description, Color3.fromRGB(230, 230, 230)) + for i, arg in ipairs(command.Args) do + if type(arg) == "function" then + arg = arg(arg) end + + context:Reply( + `{arg.Name}{if arg.Optional then "?" else ""}: {if type(arg.Type) == "string" + then arg.Type + else arg.Type.DisplayName} - {arg.Description}` + ) end else context:Reply(ARGUMENT_SHORTHANDS) @@ -63,10 +57,10 @@ return { end) local lastGroup for _, command in ipairs(commands) do - local group = command.Group or "No Group" - if lastGroup ~= group then - context:Reply(`\n{group}\n{string.rep("-", #group)}`) - lastGroup = group + command.Group = command.Group or "No Group" + if lastGroup ~= command.Group then + context:Reply(`\n{command.Group}\n{string.rep("-", #command.Group)}`) + lastGroup = command.Group end context:Reply(if command.Description then `{command.Name} - {command.Description}` else command.Name) end