From bd91d93fc9cdc20bc004732a28c6e7aee113f786 Mon Sep 17 00:00:00 2001 From: Him188 Date: Tue, 1 Sep 2020 20:45:50 +0800 Subject: [PATCH] Fix SubCommand name, use lowercase --- .../console/internal/command/CompositeCommandInternal.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/command/CompositeCommandInternal.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/command/CompositeCommandInternal.kt index 743126efd..888bbc624 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/command/CompositeCommandInternal.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/command/CompositeCommandInternal.kt @@ -297,8 +297,8 @@ internal fun AbstractReflectionCommand.createSubCommand( subCommandAnnotationResolver.getSubCommandNames(this, function) .let { namesFromAnnotation -> if (namesFromAnnotation.isNotEmpty()) { - namesFromAnnotation - } else arrayOf(function.name) + namesFromAnnotation.map(String::toLowerCase).toTypedArray() + } else arrayOf(function.name.toLowerCase()) }.also { names -> names.forEach { check(it.isValidSubName()) {