OneBotMessageOutgoing

代表一个用于OneBot API中作为 message 发送的消息内容。 它是一个仅用于序列化的类型。

在 OneBot11 协议中,API发送消息内容 message 时, 可能会有:

  • 字符串值

  • 消息段数组

  • 单个消息段对象 三种类型的数据。前两个类型分别对应 String 和 List<OneBotMessageElement>, 而第三个可以使用单元素列表表示,因此没有必要直接支持,可以使用 listOf 等方式以第二个类型实现。

由于序列化时无法保留具体的多态信息,因此 OneBotMessageOutgoing 只能保障序列化, 而无法保障反序列化,请避免使用反序列化构建 OneBotMessageOutgoing

Author

ForteScarlet

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
Link copied to clipboard

字符串值格式的值。