Fix ExactMember, ExactTemp

This commit is contained in:
Him188 2020-09-08 17:24:02 +08:00
parent 5c2a9a9553
commit 60e13e73e9
2 changed files with 5 additions and 3 deletions

View File

@ -636,7 +636,7 @@ public open class MemberCommandSender internal constructor(
public override fun toString(): String = "MemberCommandSender($user)"
@ExperimentalPermission
public override val identifier: PermissibleIdentifier = AbstractPermissibleIdentifier.ExactMember(user.id, group.id)
public override val identifier: PermissibleIdentifier = AbstractPermissibleIdentifier.ExactMember(group.id, user.id)
@JvmBlockingBridge
public override suspend fun sendMessage(message: String): MessageReceipt<Group> = sendMessage(PlainText(message))
@ -659,7 +659,8 @@ public open class TempCommandSender internal constructor(
public override fun toString(): String = "TempCommandSender($user)"
@ExperimentalPermission
override val identifier: PermissibleIdentifier = AbstractPermissibleIdentifier.ExactTemp(user.id)
public override val identifier: PermissibleIdentifier =
AbstractPermissibleIdentifier.ExactTemp(user.group.id, user.id)
@JvmBlockingBridge
public override suspend fun sendMessage(message: String): MessageReceipt<Member> = sendMessage(PlainText(message))

View File

@ -71,8 +71,9 @@ public sealed class AbstractPermissibleIdentifier(
public object AnyTemp : AbstractPermissibleIdentifier(AnyUser)
public data class ExactTemp(
public val groupId: Long,
public val id: Long
) : AbstractPermissibleIdentifier(ExactUser(id))
) : AbstractPermissibleIdentifier(ExactUser(groupId)) // TODO: 2020/9/8 ExactMember ?
public object AnyUser : AbstractPermissibleIdentifier(AnyContact)
public data class ExactUser(