mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 01:30:17 +08:00
Rename OPERATOR to ADMINISTRATOR
This commit is contained in:
parent
01c7007f3c
commit
b8323a5ed6
@ -77,21 +77,39 @@ enum class MemberPermission {
|
||||
MEMBER;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是群主
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun MemberPermission.isOwner(): Boolean = this == MemberPermission.OWNER
|
||||
|
||||
/**
|
||||
* 是管理员
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun MemberPermission.isAdministrator(): Boolean = this == MemberPermission.ADMINISTRATOR
|
||||
|
||||
/**
|
||||
* 是管理员或群主
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun MemberPermission.isAdministratorOrOwner(): Boolean = isAdministrator() || isOwner()
|
||||
inline fun MemberPermission.isOperator(): Boolean = isAdministrator() || isOwner()
|
||||
|
||||
|
||||
/**
|
||||
* 是群主
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun Member.isOwner(): Boolean = this.permission.isOwner()
|
||||
|
||||
/**
|
||||
* 是管理员
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun Member.isAdministrator(): Boolean = this.permission.isAdministrator()
|
||||
|
||||
/**
|
||||
* 时管理员或群主
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun Member.isAdministratorOrOwner(): Boolean = this.permission.isAdministratorOrOwner()
|
||||
inline fun Member.isOperator(): Boolean = this.permission.isOperator()
|
@ -135,7 +135,7 @@ internal data class MemberImpl(private val delegate: QQ, override val group: Gro
|
||||
|
||||
when (group.getMember(bot.qqAccount).permission) {
|
||||
MemberPermission.MEMBER -> return false
|
||||
MemberPermission.OPERATOR -> if (permission == MemberPermission.OPERATOR) return false
|
||||
MemberPermission.ADMINISTRATOR -> if (permission == MemberPermission.ADMINISTRATOR) return false
|
||||
MemberPermission.OWNER -> {
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user