Enhance HelpCommand output to include command arguments descriptions

This commit is contained in:
Xujiayao 2026-02-04 22:43:48 +08:00
parent 64735a9475
commit aab632eb34

View file

@ -34,8 +34,13 @@ public class HelpCommand implements Command {
StringBuilder builder = new StringBuilder();
builder.append("========== ").append(I18nManager.getDmccTranslation("commands.help.help")).append(" ==========\n");
CommandManager.getCommands().stream().sorted(Comparator.comparing(Command::name)).forEach(cmd -> builder
.append("\n").append("- ").append(cmd.name()).append(": ").append(cmd.description()));
CommandManager.getCommands().stream().sorted(Comparator.comparing(Command::name)).forEach(cmd -> {
builder.append("\n").append("- ").append(cmd.name()).append(": ").append(cmd.description());
for (Command.CommandArgument arg : cmd.args()) {
builder.append("\n ").append("<").append(arg.name()).append(">: ").append(arg.description());
}
});
sender.reply(builder.toString());
}