From cce8c2db1659fbbf0221c7dd820d294323fc1b5c Mon Sep 17 00:00:00 2001 From: Him188 Date: Wed, 9 Sep 2020 23:06:56 +0800 Subject: [PATCH] Fix permission tips --- .../mamoe/mirai/console/internal/command/CommandManagerImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/command/CommandManagerImpl.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/command/CommandManagerImpl.kt index 7fde28a03..02e6c3312 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/command/CommandManagerImpl.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/command/CommandManagerImpl.kt @@ -66,7 +66,7 @@ internal object CommandManagerImpl : CommandManager, CoroutineScope by Coroutine when (val result = sender.executeCommand(message)) { is CommandExecuteResult.PermissionDenied -> { - if (!result.command.prefixOptional) { + if (!result.command.prefixOptional || message.content.startsWith(CommandManager.commandPrefix)) { sender.sendMessage("权限不足") intercept() }