diff --git a/backend/mirai-console/src/command/BuiltInCommands.kt b/backend/mirai-console/src/command/BuiltInCommands.kt index 9a6724e1d..0f8ecf562 100644 --- a/backend/mirai-console/src/command/BuiltInCommands.kt +++ b/backend/mirai-console/src/command/BuiltInCommands.kt @@ -76,8 +76,13 @@ public object BuiltInCommands { @Handler public suspend fun CommandSender.handle() { sendMessage( - allRegisteredCommands.joinToString("\n\n") { "◆ ${it.usage}" }.lines().filterNot(String::isBlank) - .joinToString("\n") + allRegisteredCommands + .joinToString("\n\n") { command -> + val lines = command.usage.lines() + if (lines.isEmpty()) "/${command.primaryName} ${command.description}" + else + "◆ " + lines.first() + "\n" + lines.drop(1).joinToString("\n") { " $it" } + }.lines().filterNot(String::isBlank).joinToString("\n") ) } } diff --git a/backend/mirai-console/src/internal/command/CommandReflector.kt b/backend/mirai-console/src/internal/command/CommandReflector.kt index d39eb6a8f..21614293f 100644 --- a/backend/mirai-console/src/internal/command/CommandReflector.kt +++ b/backend/mirai-console/src/internal/command/CommandReflector.kt @@ -153,13 +153,13 @@ internal class CommandReflector( } else { append(CommandManager.commandPrefix) } - if (command is CompositeCommand) { + //if (command is CompositeCommand) { append(command.primaryName) append(" ") - } + //} append(subcommand.valueParameters.joinToString(" ") { it.render() }) annotationResolver.getDescription(command, subcommand.originFunction)?.let { description -> - append(" ") + append(" # ") append(description) } }