diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/permission/parseFromStringImpl.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/permission/parseFromStringImpl.kt index 71a055ade..343832ab6 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/permission/parseFromStringImpl.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/permission/parseFromStringImpl.kt @@ -16,6 +16,7 @@ import net.mamoe.mirai.console.permission.AbstractPermitteeId.* internal fun parseFromStringImpl(string: String): AbstractPermitteeId { val str = string.trim { it.isWhitespace() }.toLowerCase() + if (str == "*") return AnyContact if (str == "console") return Console if (str.isNotEmpty()) { when (str[0]) { diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/permission/PermitteeId.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/permission/PermitteeId.kt index ec46d5da7..3379e3b6d 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/permission/PermitteeId.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/permission/PermitteeId.kt @@ -266,13 +266,13 @@ public sealed class AbstractPermitteeId( /** * 表示唯一的一个好友 * - * - **直接父标识符**: [ExactUser] + * - **直接父标识符**: [ExactUser], [AnyFriend] * - **间接父标识符**: [AnyUser], [AnyContact] * - 字符串表示: "f$id" */ public data class ExactFriend( public val id: Long, - ) : AbstractPermitteeId(ExactUser(id)) { + ) : AbstractPermitteeId(ExactUser(id), AnyFriend) { override fun asString(): String = "f$id" } @@ -304,7 +304,7 @@ public sealed class AbstractPermitteeId( * 表示唯一的一个 *在临时会话发送消息的* [群成员][Member] * * - **直接父标识符**: [ExactMember] - * - **间接父标识符**: [AnyUser], [AnyMember], [ExactUser], [AnyContact] + * - **间接父标识符**: [AnyUser], [AnyMember], [ExactUser], [AnyContact], [AnyMemberFromAnyGroup] * - 字符串表示: "t$groupId.$memberId" */ public data class ExactTemp(