From 024bd230841f293133b1b472547e963c6fc52797 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 29 Feb 2020 23:48:19 +0800 Subject: [PATCH] Rename `OperableEvent` to `GroupOperableEvent` --- .../kotlin/net.mamoe.mirai/event/events/BotEvents.kt | 2 +- .../commonMain/kotlin/net.mamoe.mirai/event/events/types.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt index 2e5ba9419..cb816a329 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt @@ -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 diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/types.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/types.kt index f67d050a5..25b42589f 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/types.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/types.kt @@ -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