mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-07 00:20:09 +08:00
Allow quoting offline message sources
This commit is contained in:
parent
1a4c3ba602
commit
32eb36f817
@ -380,12 +380,12 @@ fun MessageSource.quote(): QuoteReply {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 引用这条消息
|
* 引用这条消息. 仅从服务器接收的消息 (即来自 [ContactMessage]) 才可以通过这个方式被引用.
|
||||||
* @see QuoteReply
|
* @see QuoteReply
|
||||||
*/
|
*/
|
||||||
fun MessageChain.quote(): QuoteReply {
|
fun MessageChain.quote(): QuoteReply {
|
||||||
@OptIn(MiraiInternalAPI::class)
|
@OptIn(MiraiInternalAPI::class)
|
||||||
return QuoteReply(this.source as? OnlineMessageSource ?: error("only online messages can be quoted"))
|
return QuoteReply(this.source)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user