bilibili-API-collect/docs/message/private_msg_content.md
2024-03-14 01:12:31 +08:00

104 lines
2.7 KiB
Markdown
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` 项的值为非 0 长度的文本,否则会提示 `请求错误`
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ---- |
| content | str | 私信内容 | |
**示例:**
内容为 `Hello` 的文字消息
```json
{
"content": "Hello"
}
```
## 图片消息(`msg_type=2`
在发送私信时,请确保下面的对象合法且 `url` 项的值为 B 站的图床 url否则会报 21037 `图片格式不合法,不要调戏接口啦` 错误
根对象:
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | ---------- | ------------------------- |
| url | str | 图片url | 一般为B站图床url |
| height | num | 图片高度 | 单位:像素(非必要) |
| width | num | 图片宽度 | 单位:像素(非必要) |
| type | str | 图片格式 | (非必要) |
| original | num | 是否为原图 | 当本参数值为`1`时APP上会出现“下载原图”按钮非必要 |
| size | num | 文件大小 | 单位:千字节(非必要) |
**示例:**
图片 `https://message.biliimg.com/bfs/im_new/c161fdf51d901c1607a15e30f10116dd425503913.jpg`
```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`
## 自定义表情消息(`msg_type=6`
对象结构基本同 [图片消息](#图片消息(`msg_type=6`)
## 分享消息(`msg_type=7`
## 小程序消息(`msg_type=9`
待补充
## 通知消息(`msg_type=10`
本类型消息仅可接收,不能直接发送
## 视频推送消息(`msg_type=11`
本类型消息仅可接收,不能直接发送
## 专栏推送消息(`msg_type=12`
本类型消息仅可接收,不能直接发送
## 图片卡片消息(`msg_type=13`
本类型消息仅可接收,不能直接发送
## 被关注时的自动推送消息(`msg_type=16`
## 系统提示消息(`msg_type=18`
本类型消息仅可接收,不能直接发送