Companion

object Companion

Functions

Link copied to clipboard
fun deserializeFromJsonString(string: String, json: Json = getDefaultJson()): MessageChain

从 JSON 字符串解析 MessageChain

Link copied to clipboard
fun MessageChain.deserializeFromMiraiCode(miraiCode: String, contact: Contact? = null): MessageChain

解析形如 "mirai:" 的 mirai 码, 即 CodableMessage.serializeToMiraiCode 返回的内容.

Link copied to clipboard
inline fun String.deserializeJsonToMessageChain(): MessageChain
inline fun String.deserializeJsonToMessageChain(json: Json): MessageChain

从 JSON 字符串解析 MessageChain

Link copied to clipboard
fun MessageChain.serializeToJsonString(json: Json = getDefaultJson()): String

MessageChain 序列化为 JSON 字符串.

Link copied to clipboard
@ExperimentalSerializationApi
fun MessageChain.serializeToString(format: StringFormat): String

MessageChain 序列化为指定格式的字符串.