Attachment

data class Attachment(val url: String, val properties: Map<String, String> = emptyMap())(source)

MessageAttachment

在接收的时候似乎会针对不同类型存在额外的 properties, 例如对于图片文件接收到的信息实际为:

{
"content_type": "image/gif",
"filename": "{59CA8472-3FBB-98E9-9284-FB9D3D3148BC}.jpg",
"height": 240,
"id": "2249362854",
"size": 499562,
"url": "gchat.qpic.cn/qmeetpic/47750961638939775/1701030-2249362854-59CA84723FBB98E99284FB9D3D3148BC/0",
"width": 240
}

因此 Attachment 的实际序列化借助 k/v 均为 StringMap 进行,并尝试从其中提取 url 属性赋于 url 中。

Constructors

Link copied to clipboard
constructor(url: String, properties: Map<String, String> = emptyMap())

Properties

Link copied to clipboard

此 attachment 中接收到的所有属性。

Link copied to clipboard
val url: String

下载地址