From 162f387c6b14145999f65a5c2a342c52f59dd1b0 Mon Sep 17 00:00:00 2001 From: "jiahua.liu" Date: Sat, 16 May 2020 20:26:44 +0800 Subject: [PATCH] change command structure --- .../net/mamoe/mirai/console/command/Command.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/Command.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/Command.kt index 35a7391d3..ff438859d 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/Command.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/Command.kt @@ -40,8 +40,16 @@ interface Command { annotation class PrefixOptional() } - -abstract class CompositeCommand(val name:String, val alias:Array = listOf()):Command{ +/** + * 功能最集中的Commend + * 支持且只支持有sub的指令 + * 例: + * /mute add + * /mute remove + * /mute addandremove (sub is case insensitive, lowercase are recommend) + * /mute add and remove('add and remove' consider as a sub) + */ +abstract class CompositeCommand(val name:String, val alias:Array = arrayOf()):Command{ /** * 你应当使用 @SubCommand 来注册 sub 指令 */