Explicitly state return type

This commit is contained in:
Him188 2020-02-21 22:30:55 +08:00
parent 99586f226d
commit eb258bbd5c

View File

@ -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<Group> = 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<Group> = reply(this.message.quote() + message)
suspend inline fun quoteReply(plain: String): MessageReceipt<Group> = reply(this.message.quote() + plain)
@JvmName("reply2")
suspend inline fun String.quoteReply() = quoteReply(this)
suspend inline fun String.quoteReply(): MessageReceipt<Group> = quoteReply(this)
@JvmName("reply2")
suspend inline fun Message.quoteReply() = quoteReply(this)
suspend inline fun Message.quoteReply(): MessageReceipt<Group> = quoteReply(this)
@JvmName("reply2")
suspend inline fun MessageChain.quoteReply() = quoteReply(this)
suspend inline fun MessageChain.quoteReply(): MessageReceipt<Group> = 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)"