mirai-core / net.mamoe.mirai.message.data / ForwardMessage / DisplayStrategy

DisplayStrategy

abstract class DisplayStrategy

See Also

ForwardMessage

Types

Default

companion object Default : DisplayStrategy

Constructors

<init>

DisplayStrategy()

Functions

generateBrief

显示在消息列表中的预览.

open fun generateBrief(forward: ForwardMessage): String

generatePreview

显示在卡片 body 中, 只会显示 sequence 前四个元素. Java 用户: 使用 sequenceOf (SequenceKt.sequenceOf) 或 asSequence (SequenceKt.asSequence)

open fun generatePreview(forward: ForwardMessage): Sequence<String>

generateSource

目前未发现在哪能显示

open fun generateSource(forward: ForwardMessage): String

generateSummary

显示在卡片底部

open fun generateSummary(forward: ForwardMessage): String

generateTitle

修改后卡片标题会变为 "转发的聊天记录", 而此函数的返回值会显示在 preview 前

open fun generateTitle(forward: ForwardMessage): String

Companion Object Functions

invoke

operator fun invoke(generateTitle: (forward: ForwardMessage) -> String = Default::generateTitle, generateBrief: (forward: ForwardMessage) -> String = Default::generateBrief, generateSource: (forward: ForwardMessage) -> String = Default::generateSource, generatePreview: (forward: ForwardMessage) -> Sequence<String> = Default::generatePreview, generateSummary: (forward: ForwardMessage) -> String = Default::generateSummary): DisplayStrategy