|
|
@@ -17,8 +17,6 @@ import net.mamoe.mirai.Bot
|
|
|
import net.mamoe.mirai.IMirai
|
|
|
import net.mamoe.mirai.Mirai
|
|
|
import net.mamoe.mirai.contact.*
|
|
|
-import net.mamoe.mirai.message.MessageReceipt.Companion.quote
|
|
|
-import net.mamoe.mirai.message.MessageReceipt.Companion.quoteReply
|
|
|
import net.mamoe.mirai.message.data.*
|
|
|
import net.mamoe.mirai.message.data.MessageSource.Key.quote
|
|
|
import net.mamoe.mirai.message.data.MessageSource.Key.recallIn
|
|
|
@@ -56,55 +54,50 @@ public open class MessageReceipt<out C : Contact> @MiraiInternalApi constructor(
|
|
|
*/
|
|
|
public val isToGroup: Boolean get() = target is Group
|
|
|
|
|
|
- public companion object {
|
|
|
- /**
|
|
|
- * 撤回这条消息.
|
|
|
- *
|
|
|
- * @see IMirai.recallMessage
|
|
|
- */
|
|
|
- @JvmBlockingBridge
|
|
|
- @JvmStatic
|
|
|
- public suspend inline fun MessageReceipt<*>.recall() {
|
|
|
- return Mirai.recallMessage(target.bot, source)
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 撤回这条消息.
|
|
|
+ *
|
|
|
+ * @see IMirai.recallMessage
|
|
|
+ */
|
|
|
+ @JvmBlockingBridge
|
|
|
+ public suspend inline fun recall() {
|
|
|
+ return Mirai.recallMessage(target.bot, source)
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 在一段时间后撤回这条消息.
|
|
|
- *
|
|
|
- * @see IMirai.recallMessage
|
|
|
- */
|
|
|
- @JvmStatic
|
|
|
- @Suppress("DeferredIsResult")
|
|
|
- public fun MessageReceipt<*>.recallIn(millis: Long): Deferred<Unit> = this.source.recallIn(millis)
|
|
|
+ /**
|
|
|
+ * 在一段时间后撤回这条消息.
|
|
|
+ *
|
|
|
+ * @see IMirai.recallMessage
|
|
|
+ */
|
|
|
+ @Suppress("DeferredIsResult")
|
|
|
+ public fun recallIn(millis: Long): Deferred<Unit> = this.source.recallIn(millis)
|
|
|
|
|
|
- /**
|
|
|
- * 引用这条消息.
|
|
|
- * @see MessageSource.quote 引用一条消息
|
|
|
- */
|
|
|
- @JvmStatic
|
|
|
- public inline fun MessageReceipt<*>.quote(): QuoteReply = this.source.quote()
|
|
|
+ /**
|
|
|
+ * 引用这条消息.
|
|
|
+ * @see MessageSource.quote 引用一条消息
|
|
|
+ */
|
|
|
+ public fun quote(): QuoteReply = this.source.quote()
|
|
|
|
|
|
- /**
|
|
|
- * 引用这条消息并回复.
|
|
|
- * @see MessageSource.quote 引用一条消息
|
|
|
- */
|
|
|
- @JvmStatic
|
|
|
- @JvmBlockingBridge
|
|
|
- public suspend inline fun <C : Contact> MessageReceipt<C>.quoteReply(message: Message): MessageReceipt<C> {
|
|
|
- @Suppress("UNCHECKED_CAST")
|
|
|
- return target.sendMessage(this.quote() + message) as MessageReceipt<C>
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 引用这条消息并回复.
|
|
|
+ * @see MessageSource.quote 引用一条消息
|
|
|
+ */
|
|
|
+ @JvmBlockingBridge
|
|
|
+ public suspend inline fun quoteReply(message: Message): MessageReceipt<C> {
|
|
|
+ @Suppress("UNCHECKED_CAST")
|
|
|
+ return target.sendMessage(this.quote() + message) as MessageReceipt<C>
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 引用这条消息并回复.
|
|
|
- * @see MessageSource.quote 引用一条消息
|
|
|
- */
|
|
|
- @JvmBlockingBridge
|
|
|
- @JvmStatic
|
|
|
- public suspend inline fun <C : Contact> MessageReceipt<C>.quoteReply(message: String): MessageReceipt<C> {
|
|
|
- return this.quoteReply(PlainText(message))
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 引用这条消息并回复.
|
|
|
+ * @see MessageSource.quote 引用一条消息
|
|
|
+ */
|
|
|
+ @JvmBlockingBridge
|
|
|
+ public suspend inline fun quoteReply(message: String): MessageReceipt<C> {
|
|
|
+ return this.quoteReply(PlainText(message))
|
|
|
}
|
|
|
+
|
|
|
+ public companion object
|
|
|
}
|
|
|
|
|
|
/**
|