diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/description/CommandArgumentParserBuiltins.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/description/CommandArgumentParserBuiltins.kt index b78fc129c..3484296f1 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/description/CommandArgumentParserBuiltins.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/description/CommandArgumentParserBuiltins.kt @@ -320,7 +320,8 @@ public object PermissionIdArgumentParser : CommandArgumentParser { @ExperimentalPermission public object PermissibleIdentifierArgumentParser : CommandArgumentParser { override fun parse(raw: String, sender: CommandSender): PermissibleIdentifier { - return kotlin.runCatching { AbstractPermissibleIdentifier.parseFromString(raw) }.getOrElse { + return if (raw == "~") sender.identifier + else kotlin.runCatching { AbstractPermissibleIdentifier.parseFromString(raw) }.getOrElse { illegalArgument("无法解析 $raw 为 PermissibleIdentifier") } }