ForwardMessage

data class ForwardMessage(preview: List<String>, title: String, brief: String, source: String, summary: String, nodeList: List<ForwardMessage.Node>) : MessageContent, ConstrainSingle

合并转发消息

显示方案

移动端

在移动客户端将会显示为卡片

|-------------------------|
| <title> |
| <preview> |
|-------------------------|
| <summary> |
|-------------------------|

默认显示方案:

|-------------------------|
| 群聊的聊天记录 |
| <消息 1> |
| <消息 2> |
| <消息 3> |
|-------------------------|
| 查看3条转发消息 |
|-------------------------|

PC 端

在部分 PC 端显示为类似移动端的卡片, 在其他 PC 端显示为以下格式

鸽子 A 2020/04/23 11:27:54

鸽子 B 2020/04/23 11:27:55

鸽子 C 1970/01/01 08:00:00
咕咕咕

构造

See also

Constructors

ForwardMessage
Link copied to clipboard
fun ForwardMessage(preview: List<String>, title: String, brief: String, source: String, summary: String, nodeList: List<ForwardMessage.Node>)

Types

DisplayStrategy
Link copied to clipboard
interface DisplayStrategy

合并转发卡片展示策略. 用于 RawForwardMessage渲染.

INode
Link copied to clipboard
interface INode

请构造 Node

Key
Link copied to clipboard
object Key : AbstractPolymorphicMessageKey<MessageContent, ForwardMessage>
Node
Link copied to clipboard
data class Node(senderId: Long, time: Int, senderName: String, messageChain: MessageChain) : ForwardMessage.INode

消息节点

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
open override 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 连接到这个消息的尾部.

Properties

brief
Link copied to clipboard
val brief: String
key
Link copied to clipboard
open override val key: MessageKey<ForwardMessage>

用于判断是否为同一种元素的 MessageKey. 使用多态类型 MessageKey 最上层的 MessageKey.

nodeList
Link copied to clipboard
val nodeList: List<ForwardMessage.Node>
preview
Link copied to clipboard
val preview: List<String>
source
Link copied to clipboard
val source: String
summary
Link copied to clipboard
val summary: String
title
Link copied to clipboard
val title: String