6 Commits

Author SHA1 Message Date
208169c2a2 Merge pull request #312 from tobycroft/patch-2
Update configuration.md
2024-03-24 15:46:39 +08:00
019d1c7977 Update configuration.md
allow-temp-session说明更新
2024-03-23 18:55:12 +08:00
af9f1d5aae Merge pull request #302 from tobycroft/patch-1
Update resources.md
2024-03-18 15:21:56 +08:00
cb9176cca0 Update resources.md 2024-03-18 14:01:47 +08:00
6384694edd Update resources.md 2024-03-18 13:38:19 +08:00
4a11f64cf5 Update resources.md
修改get_record
新增get_file
2024-03-18 13:36:27 +08:00
2 changed files with 28 additions and 3 deletions

View File

@ -99,6 +99,7 @@ icon: video-camera
| ---- | ------ | -------- |
| file | string | 文件路径 |
| url | string | 文件 URL |
| md5 | string | 文件md5,get_file的时候用这个较稳定然后你程序如果是反向ws可以用这个作为record的等待ident |
## 检查是否可以发送语音 <Badge text="未实现" type="danger" />
@ -141,9 +142,31 @@ icon: video-camera
| ------ | -------- | ------------------------------------------------------------------------------------------------- |
| file | string | 转换后的语音文件路径, 如 `/home/somebody/cqhttp/data/record/0B38145AA44505000B38145AA4450500.mp3` |
## 获取文件 <Badge text="未实现" type="danger" />
## 获取文件
该接口用于获取文件。
该接口用于获取语音哦当然这个接口目前使用的是base64返回主要为了照顾使用反向websocket的用户如果是正向用户或者getpost用户直接用/res/去拿数据更方便
如果你选择压缩目前文本压缩性能较好如果是音频或者视频压缩率只有95.7%左右大概只能节省5%的带宽,是否使用压缩获取可以自行考虑
### API 端点
`/get_file`
### 参数
| 字段 | 类型 | 必须 | 说明 |
| ---------- | ------ | ---- | -------- |
| file | string | 是 | 文件 MD5 |
| file_type | string | 是 | 输出格式,支持base64|gzip,如果获取大文件,可以选择压缩 |
### 响应
| 字段 | 类型 | 说明 |
| ---- | ------ | -------- |
| file | string | 文件路径,和get_record一样 |
| base64String | string | 文件 URL |
| md5 | string | 文件md5 |
## 获取视频 <Badge text="未实现" type="danger" />

View File

@ -63,10 +63,12 @@ icon: cog
heartbeat_interval: 15000 // 设置为null则默认15000毫秒作为心跳间隔0则为无心跳
}
],
'allow-temp-session': false // 是否允许临时消息
}
```
> 2024-3allow-temp-session已经在后续版本中去除未来需要在你自己的接收端对消息来源进行拦截或处理
| 参数名称 | 类型 | 作用 | 例子 |
| --------------- | -------- | -------------------------------------------------------------------------------- | ----------- |
| `default_token` | `string` | 默认 `token` **HTTP接口/主被动WS** 如果未单独定义 `token` ,则使用默认 `token` | `aaa123456` |