bilibili-API-collect/docs/message/private_msg_content.md.txt
wuziqian211 d04d4193be update
2024-03-13 03:02:27 +08:00

58 lines
1.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 私信消息类型、内容说明
## 文字消息(`msg_type=1`
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ---- |
| content | str | 私信内容 | |
**示例:**
```json
{
"content": "Hello"
}
```
## 图片消息(`msg_type=2`
根对象:
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | ---------- | ------------------------- |
| url | str | 图片url | 默认为B站相簿图片上传通道 |
| height | num | 图片高度 | 单位:像素(非必要) |
| width | num | 图片宽度 | 单位:像素(非必要) |
| type | str | 图片格式 | (非必要) |
| original | num | 是否为原图 | 当本参数值为`1`时APP上会出现“下载原图”按钮非必要 |
| size | num | 文件大小 | 单位:千字节(非必要) |
**示例:**
```json
{
"url": "https://message.biliimg.com/bfs/im_new/c161fdf51d901c1607a15e30f10116dd425503913.jpg",
"height": 300,
"width": 300,
"imageType": "jpeg",
"original": 1,
"size": 55.443
}
```
## 撤回消息(`msg_type=5`
内容为目标私信的`msg_key`,请确保发送的私信与目标私信在同一会话内;发送此私信后,目标私信的 `msg_status` 会改成 `1`
**示例:**
假如存在 `msg_key` 为 `7345551441311046575` 的私信 A用户发送了 `msg_type` 为 `5` 且 `content` 为以下内容的私信 B
```json
7345551441311046575
```
这时,私信 A 就会被撤回,并且其 `msg_status` 也会改变成 `1`