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 b8c3eb8fc..0bfd0a01e 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 @@ -162,10 +162,10 @@ fun MessagePacket<*, *>.isContextIdenticalWith(another: MessagePacket<*, *>): Bo suspend inline fun > P.nextMessage( timeoutMillis: Long = -1, crossinline filter: P.(P) -> Boolean -): P { +): MessageChain { return subscribingGet(timeoutMillis) { takeIf { this.isContextIdenticalWith(this@nextMessage) }?.takeIf { filter(it, it) } - } + }.message } /** @@ -179,8 +179,8 @@ suspend inline fun > P.nextMessage( */ suspend inline fun > P.nextMessage( timeoutMillis: Long = -1 -): P { +): MessageChain { return subscribingGet(timeoutMillis) { takeIf { this.isContextIdenticalWith(this@nextMessage) } - } + }.message } \ No newline at end of file