1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-06 03:53:50 +08:00
go-cqhttp/docs/cqhttp.md
2020-07-27 04:57:17 +08:00

84 lines
2.4 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.

# 拓展API
由于部分 api 原版 CQHTTP 并未实现go-cqhttp 修改并增加了一些拓展 api .
## CQCode
| Code | 示例 | 说明 |
| ------- | -------------------- | ------------------------------------------------------------ |
| reply | [CQ:reply,id=123456] | 回复ID为 `123456`的信息. 发送时一条 `message` 仅能使用一次 |
| forward | [CQ:forward,id=abcd] | ID为abcd的转发消息, 暂时仅能接收. 可通过 `/get_forward_msg` API获取具体信息 |
## API
`/set_group_name` **设置群名**
**参数**
| 字段 | 类型 | 说明 |
| -------- | ------ | ---- |
| group_id | int64 | 群号 |
| name | string | 新名 |
`/get_image` **获取图片信息**
> 该接口为 CQHTTP 接口修改
参数
| 字段 | 类型 | 说明 |
| ------ | ------ | -------------- |
| `file` | string | 图片缓存文件名 |
响应数据
| 字段 | 类型 | 说明 |
| ---------- | ------ | -------------- |
| `size` | int32 | 图片源文件大小 |
| `filename` | string | 图片文件原名 |
| `url` | string | 图片下载地址 |
`/get_group_msg` **获取群消息**
参数
| 字段 | 类型 | 说明 |
| ------------ | ----- | ------ |
| `message_id` | int32 | 消息id |
响应数据
| 字段 | 类型 | 说明 |
| ------------ | ------- | ---------- |
| `message_id` | int32 | 消息id |
| `real_id` | int32 | 消息真实id |
| `sender` | object | 发送者 |
| `time` | int32 | 发送时间 |
| `content` | message | 消息内容 |
`/get_forward_msg` **获取转发消息信息**
参数
| 字段 | 类型 | 说明 |
| ------------ | ------ | ------ |
| `message_id` | string | 消息id |
## 事件
#### 群消息撤回
**上报数据**
| 字段 | 类型 | 可能的值 | 说明 |
| ------------- | ------ | -------------- | -------------- |
| `post_type` | string | `notice` | 上报类型 |
| `notice_type` | string | `group_recall` | 消息类型 |
| `group_id` | int64 | | 群号 |
| `user_id` | int64 | | 消息发送者id |
| `operator_id` | int64 | | 操作者id |
| `message_id` | int64 | | 被撤回的消息id |