mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-11 02:50:15 +08:00
Fix generated usage for CompositeCommand
This commit is contained in:
parent
a7dbe82256
commit
ad53f315ac
@ -12,6 +12,7 @@
|
|||||||
package net.mamoe.mirai.console.internal.command
|
package net.mamoe.mirai.console.internal.command
|
||||||
|
|
||||||
import net.mamoe.mirai.console.command.*
|
import net.mamoe.mirai.console.command.*
|
||||||
|
import net.mamoe.mirai.console.command.Command.Companion.primaryName
|
||||||
import net.mamoe.mirai.console.command.description.CommandArgumentContext
|
import net.mamoe.mirai.console.command.description.CommandArgumentContext
|
||||||
import net.mamoe.mirai.console.command.description.CommandArgumentContextAware
|
import net.mamoe.mirai.console.command.description.CommandArgumentContextAware
|
||||||
import net.mamoe.mirai.message.data.PlainText
|
import net.mamoe.mirai.message.data.PlainText
|
||||||
@ -228,7 +229,15 @@ internal fun Array<AbstractReflectionCommand.SubCommandDescriptor>.createUsage(b
|
|||||||
internal fun AbstractReflectionCommand.SubCommandDescriptor.createUsage(baseCommand: AbstractReflectionCommand): String =
|
internal fun AbstractReflectionCommand.SubCommandDescriptor.createUsage(baseCommand: AbstractReflectionCommand): String =
|
||||||
buildString {
|
buildString {
|
||||||
if (!baseCommand.prefixOptional) {
|
if (!baseCommand.prefixOptional) {
|
||||||
|
append("(")
|
||||||
append(CommandManager.commandPrefix)
|
append(CommandManager.commandPrefix)
|
||||||
|
append(")")
|
||||||
|
} else {
|
||||||
|
append(CommandManager.commandPrefix)
|
||||||
|
}
|
||||||
|
if (baseCommand is CompositeCommand) {
|
||||||
|
append(baseCommand.primaryName)
|
||||||
|
append(" ")
|
||||||
}
|
}
|
||||||
append(names.first())
|
append(names.first())
|
||||||
append(" ")
|
append(" ")
|
||||||
|
Loading…
Reference in New Issue
Block a user