From 074236ceda51d789eae5468636512b78e47941ac Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 21 Mar 2020 02:18:44 +0800 Subject: [PATCH] Check bot for `isContextIdenticalWith` --- .../commonMain/kotlin/net.mamoe.mirai/message/MessagePacket.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/MessagePacket.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/MessagePacket.kt index 2e0b42f0f..759bb21d0 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/MessagePacket.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/MessagePacket.kt @@ -198,8 +198,9 @@ abstract class MessagePacketBase : Packet, Bot /** * 判断两个 [MessagePacket] 的 [MessagePacket.sender] 和 [MessagePacket.subject] 是否相同 */ +@SinceMirai("0.29.0") fun MessagePacket<*, *>.isContextIdenticalWith(another: MessagePacket<*, *>): Boolean { - return this.sender == another.sender && this.subject == another.subject + return this.sender == another.sender && this.subject == another.subject && this.bot == another.bot } /**