MessageContent

interface MessageContent : SingleMessage

带内容的消息.

See also

Types

Key
Link copied to clipboard
object Key : AbstractMessageKey<MessageContent>

Functions

contentEquals
Link copied to clipboard
open fun contentEquals(another: String, ignoreCase: Boolean = false): Boolean

判断内容是否与 another 相等.

open fun contentEquals(another: Message, ignoreCase: Boolean = false): Boolean

判断内容是否与 another 相等即 thisanothercontentToString 相等.

open fun contentEquals(another: Message, ignoreCase: Boolean = false, strict: Boolean = false): Boolean

判断内容是否与 another 相等即 thisanothercontentToString 相等. stricttrue 时, 还会额外判断每个消息元素的类型, 顺序和属性. 如 Image 会判断 Image.imageId

contentToString
Link copied to clipboard
abstract fun contentToString(): String

转为最接近官方格式的字符串. 如 At(member) + "test" 将转为 "@群名片 test".

followedBy
Link copied to clipboard
open fun followedBy(tail: Message): MessageChain

thistail 连接.

plus
Link copied to clipboard
open operator fun plus(another: Array<out Message>): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: CharSequence): MessageChain

another 作为 PlainText 连接到这个消息的尾部.

open operator fun plus(another: String): MessageChain

another 作为 PlainText 连接到这个消息的尾部.

open operator fun plus(another: Iterable<String>): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: Iterable<Message>): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: Sequence<Message>): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: Message): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: MessageChain): MessageChain

another 按顺序连接到这个消息的尾部.

open operator fun plus(another: SingleMessage): MessageChain

another 连接到这个消息的尾部.

toString
Link copied to clipboard
abstract override fun toString(): String

得到包含 mirai 消息元素代码的, 易读的字符串. 如 At(member) + "test" 将转为 "[mirai:at:qqId]test".

Inheritors

At
Link copied to clipboard
AtAll
Link copied to clipboard
Audio
Link copied to clipboard
Face
Link copied to clipboard
FlashImage
Link copied to clipboard
ForwardMessage
Link copied to clipboard
HummerMessage
Link copied to clipboard
Image
Link copied to clipboard
MusicShare
Link copied to clipboard
PlainText
Link copied to clipboard
RichMessage
Link copied to clipboard
UnsupportedMessage
Link copied to clipboard