From 21c8fa402d5ec438225d9dfea9f7fda3e09ffe63 Mon Sep 17 00:00:00 2001 From: Him188 Date: Tue, 3 Dec 2019 12:36:27 +0800 Subject: [PATCH] Add At.qq to provide a quick way to get the target --- .../network/protocol/tim/packet/event/MessageEvent.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/MessageEvent.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/MessageEvent.kt index 328f2bed7..48c6b3314 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/MessageEvent.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/MessageEvent.kt @@ -91,6 +91,8 @@ abstract class MessagePacketBase : EventPacket, BotEvent() { suspend inline fun Image.downloadAsByteArray(): ByteArray = getLink().downloadAsByteArray() suspend inline fun Image.download(): ByteReadPacket = getLink().download() // endregion + + suspend inline fun At.qq(): QQ = bot.getQQ(this.target) } // region group message