CombinedMessage
class CombinedMessage constructor( val element: Message, val tail: Message, val hasConstrainSingle: Boolean) : MessageChainImpl, List<SingleMessage>
Content copied to clipboard
One after one, hierarchically.
Since
2.12
Constructors
Link copied to clipboard
fun CombinedMessage( element: Message, tail: Message, hasConstrainSingle: Boolean)
Content copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
open operator fun <M : SingleMessage> contains(key: MessageKey<M>): Boolean
Content copied to clipboard
当存在 ConstrainSingle.key 为 key 的 SingleMessage 实例时返回 true
.
Link copied to clipboard
open override fun containsAll(elements: Collection<SingleMessage>): Boolean
Content copied to clipboard
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 连接.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
转换为 mirai 码.
Properties
Link copied to clipboard
去重算法 v1 - 2.12: 在连接时若只有 0-1 方包含 ConstrainSingle, 则使用 CombinedMessage 优化性能. 否则使用旧版复杂去重算法构造 LinearMessageChainImpl.