QuoteReply
data class QuoteReply(val source: MessageSource) : Message, MessageMetadata, ConstrainSingle
Content copied to clipboard
引用回复. QuoteReply 被作为 MessageMetadata, 因为它不包含实际的消息内容.
支持引用任何一条消息发送给任何人.
引用回复的原消息内容完全由 source 中 MessageSource.originalMessage 控制, 客户端不会自行寻找原消息. 可通过 MessageSource.copyAmend 修改引用的消息内容.
客户端通过 MessageSource.ids 等数据定位源消息, 在修改时使用 MessageSourceBuilder.metadata 可以修改定位结果.
创建引用回复
直接构造 QuoteReply:
new QuoteReply(source)
在 Kotlin 使用扩展 MessageSource.quote
See also
获取有关消息源的更多信息
Constructors
Types
Functions
Link copied to clipboard
open fun contentEquals(another: String, ignoreCase: Boolean = false): Boolean
Content copied to clipboard
判断内容是否与 another 相等.
open fun contentEquals(another: Message, ignoreCase: Boolean = false): Boolean
Content copied to clipboard
判断内容是否与 another 相等即 this
与 another 的 contentToString 相等.
open fun contentEquals( another: Message, ignoreCase: Boolean = false, strict: Boolean = false): Boolean
Content copied to clipboard
判断内容是否与 another 相等即 this
与 another 的 contentToString 相等. strict 为 true
时, 还会额外判断每个消息元素的类型, 顺序和属性. 如 Image 会判断 Image.imageId
Link copied to clipboard
转为最接近官方格式的字符串. 如 At(member) + "test"
将转为 "@群名片 test"
.
Link copied to clipboard
将 this
和 tail 连接.
Properties
Link copied to clipboard
用于判断是否为同一种元素的 MessageKey. 使用多态类型 MessageKey 最上层的 MessageKey.
Link copied to clipboard
指代被引用的消息. 其中 MessageSource.originalMessage 可以控制客户端显示的消息内容.