From eb258bbd5c74e425ee29c17d5e295ea2e557d9b7 Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 21 Feb 2020 22:30:55 +0800 Subject: [PATCH] Explicitly state return type --- .../net.mamoe.mirai/message/GroupMessage.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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)"