Rename OperableEvent to GroupOperableEvent

This commit is contained in:
Him188 2020-02-29 23:48:19 +08:00
parent e86256fb39
commit 024bd23084
2 changed files with 4 additions and 4 deletions

View File

@ -120,7 +120,7 @@ sealed class MessageRecallEvent : BotEvent {
override val messageId: Long,
override val messageTime: Int,
/**
* 操作人. null
* 操作人. null 时则为 [Bot] 操作.
*/
override val operator: Member?,
override val group: Group

View File

@ -57,7 +57,7 @@ interface GroupMemberEvent : GroupEvent {
* @see isByBot
* @see operatorOrBot
*/
interface OperableEvent : GroupEvent {
interface GroupOperableEvent : GroupEvent {
/**
* 操作人, `null` 时为 [Bot] 操作
*/
@ -67,14 +67,14 @@ interface OperableEvent : GroupEvent {
/**
* 是否由 [Bot] 操作
*/
val OperableEvent.isByBot: Boolean get() = operator == null
val GroupOperableEvent.isByBot: Boolean get() = operator == null
/**
* 当操作人为 [Member] 时获取这个 [Member],
* 当操作人为 [Bot] 时获取 [Group.botAsMember]
*/
@UseExperimental(MiraiExperimentalAPI::class)
val OperableEvent.operatorOrBot: Member
val GroupOperableEvent.operatorOrBot: Member
get() = this.operator ?: this.group.botAsMember