diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/GroupMessage.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/GroupMessage.kt index 6f2b62a97..f14d0689e 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/GroupMessage.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/GroupMessage.kt @@ -9,6 +9,7 @@ package net.mamoe.mirai.message +import kotlinx.coroutines.Job import net.mamoe.mirai.Bot import net.mamoe.mirai.contact.* import net.mamoe.mirai.event.Event @@ -44,25 +45,25 @@ class GroupMessage( * 对于好友消息事件, 这个方法将会给好友 ([subject]) 发送消息 * 对于群消息事件, 这个方法将会给群 ([subject]) 发送消息 */ - suspend inline fun quoteReply(message: MessageChain) = reply(this.message.quote() + message) + suspend inline fun quoteReply(message: MessageChain): MessageReceipt = reply(this.message.quote() + message) - suspend inline fun quoteReply(message: Message) = reply(this.message.quote() + message) - suspend inline fun quoteReply(plain: String) = reply(this.message.quote() + plain) + suspend inline fun quoteReply(message: Message): MessageReceipt = reply(this.message.quote() + message) + suspend inline fun quoteReply(plain: String): MessageReceipt = reply(this.message.quote() + plain) @JvmName("reply2") - suspend inline fun String.quoteReply() = quoteReply(this) + suspend inline fun String.quoteReply(): MessageReceipt = quoteReply(this) @JvmName("reply2") - suspend inline fun Message.quoteReply() = quoteReply(this) + suspend inline fun Message.quoteReply(): MessageReceipt = quoteReply(this) @JvmName("reply2") - suspend inline fun MessageChain.quoteReply() = quoteReply(this) + suspend inline fun MessageChain.quoteReply(): MessageReceipt = quoteReply(this) suspend inline fun MessageChain.recall() = group.recall(this) suspend inline fun MessageSource.recall() = group.recall(this) - inline fun MessageSource.recallIn(delay: Long) = group.recallIn(this, delay) - inline fun MessageChain.recallIn(delay: Long) = group.recallIn(this, delay) + inline fun MessageSource.recallIn(delay: Long): Job = group.recallIn(this, delay) + inline fun MessageChain.recallIn(delay: Long): Job = group.recallIn(this, delay) override fun toString(): String = "GroupMessage(group=${group.id}, senderName=$senderName, sender=${sender.id}, permission=${permission.name}, message=$message)"