1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

📝 update readme

This commit is contained in:
yanyongyu 2020-12-25 14:18:37 +08:00
parent 05f2503631
commit 7b831cfa1e

View File

@ -1,20 +1,57 @@
<p align="center">
<a href="https://ishkong.github.io/go-cqhttp-docs/"><img src="https://i.loli.net/2020/12/20/qSLMDWxiocRQgu6.jpg" width="200" height="200" alt="go-cqhttp"></a>
</p>
<div align="center">
# go-cqhttp # go-cqhttp
使用 [mirai](https://github.com/mamoe/mirai) 以及 [MiraiGo](https://github.com/Mrs4s/MiraiGo) 开发的cqhttp golang原生实现, 并在[cqhttp原版](https://github.com/richardchien/coolq-http-api)的基础上做了部分修改和拓展.
文档暂时可前往[Go-cqhttp帮助中心](http://ishkong.github.io/go-cqhttp-docs)查看, 目前还在撰写中. _✨ 基于 [Mirai](https://github.com/mamoe/mirai) 以及 [MiraiGo](https://github.com/Mrs4s/MiraiGo) 的 [cqhttp](https://github.com/howmanybots/onebot/blob/master/README.md) golang 原生实现 ✨_
测试版可前往 Release 下载 </div>
# 兼容性 <p align="center">
<a href="https://raw.githubusercontent.com/Mrs4s/go-cqhttp/master/LICENSE">
<img src="https://img.shields.io/github/license/Mrs4s/go-cqhttp" alt="license">
</a>
<a href="https://github.com/Mrs4s/go-cqhttp/releases">
<img src="https://img.shields.io/github/v/release/Mrs4s/go-cqhttp?color=blueviolet&include_prereleases" alt="release">
</a>
<a href="https://github.com/howmanybots/onebot/blob/master/README.md">
<img src="https://img.shields.io/badge/OneBot-v11-blue?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMAAABYR2ztAAAAIVBMVEUAAAAAAAADAwMHBwceHh4UFBQNDQ0ZGRkoKCgvLy8iIiLWSdWYAAAAAXRSTlMAQObYZgAAAQVJREFUSMftlM0RgjAQhV+0ATYK6i1Xb+iMd0qgBEqgBEuwBOxU2QDKsjvojQPvkJ/ZL5sXkgWrFirK4MibYUdE3OR2nEpuKz1/q8CdNxNQgthZCXYVLjyoDQftaKuniHHWRnPh2GCUetR2/9HsMAXyUT4/3UHwtQT2AggSCGKeSAsFnxBIOuAggdh3AKTL7pDuCyABcMb0aQP7aM4AnAbc/wHwA5D2wDHTTe56gIIOUA/4YYV2e1sg713PXdZJAuncdZMAGkAukU9OAn40O849+0ornPwT93rphWF0mgAbauUrEOthlX8Zu7P5A6kZyKCJy75hhw1Mgr9RAUvX7A3csGqZegEdniCx30c3agAAAABJRU5ErkJggg==" alt="cqhttp">
</a>
<a href="https://github.com/Mrs4s/go-cqhttp/actions">
<img src="https://github.com/Mrs4s/go-cqhttp/workflows/CI/badge.svg" alt="action">
</a>
</p>
<p align="center">
<a href="http://ishkong.github.io/go-cqhttp-docs">文档</a>
·
<a href="https://github.com/Mrs4s/go-cqhttp/releases">下载</a>
·
<a href="https://ishkong.github.io/go-cqhttp-docs/guide/quick_start.html">开始使用</a>
</p>
---
go-cqhttp 在[原版 cqhttp](https://github.com/richardchien/coolq-http-api)的基础上做了部分修改和拓展.
---
## 兼容性
### 接口
#### 接口
- [x] HTTP API - [x] HTTP API
- [x] 反向 HTTP POST - [x] 反向 HTTP POST
- [x] 正向 Websocket - [x] 正向 Websocket
- [x] 反向 Websocket - [x] 反向 Websocket
#### 拓展支持 ### 拓展支持
> 拓展 API 可前往 [文档](docs/cqhttp.md) 查看 > 拓展 API 可前往 [文档](docs/cqhttp.md) 查看
- [x] HTTP POST 多点上报 - [x] HTTP POST 多点上报
- [x] 反向 WS 多点连接 - [x] 反向 WS 多点连接
- [x] 修改群名 - [x] 修改群名
@ -23,13 +60,15 @@
- [x] 解析/发送 合并转发 - [x] 解析/发送 合并转发
- [x] 使用代理请求网络图片 - [x] 使用代理请求网络图片
#### 实现 ### 实现
<details> <details>
<summary>已实现CQ码</summary> <summary>已实现CQ码</summary>
##### 符合Onebot标准的CQ码 #### 符合 Onebot 标准的 CQ 码
| CQ 码 | 功能 | | CQ 码 | 功能 |
| ------------ | ---------------------------- | | ------------ | --------------------------- |
| [CQ:face] | [QQ 表情] | | [CQ:face] | [QQ 表情] |
| [CQ:record] | [语音] | | [CQ:record] | [语音] |
| [CQ:video] | [短视频] | | [CQ:video] | [短视频] |
@ -42,7 +81,7 @@
| [CQ:xml] | [XML 消息] | | [CQ:xml] | [XML 消息] |
| [CQ:json] | [JSON 消息] | | [CQ:json] | [JSON 消息] |
[QQ表情]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#qq-%E8%A1%A8%E6%83%85 [qq 表情]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#qq-%E8%A1%A8%E6%83%85
[语音]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E8%AF%AD%E9%9F%B3 [语音]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E8%AF%AD%E9%9F%B3
[短视频]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E7%9F%AD%E8%A7%86%E9%A2%91 [短视频]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E7%9F%AD%E8%A7%86%E9%A2%91
[@某人]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E6%9F%90%E4%BA%BA [@某人]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E6%9F%90%E4%BA%BA
@ -52,12 +91,13 @@
[回复]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E5%9B%9E%E5%A4%8D [回复]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E5%9B%9E%E5%A4%8D
[合并转发]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E5%90%88%E5%B9%B6%E8%BD%AC%E5%8F%91- [合并转发]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E5%90%88%E5%B9%B6%E8%BD%AC%E5%8F%91-
[合并转发节点]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E5%90%88%E5%B9%B6%E8%BD%AC%E5%8F%91%E8%8A%82%E7%82%B9- [合并转发节点]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#%E5%90%88%E5%B9%B6%E8%BD%AC%E5%8F%91%E8%8A%82%E7%82%B9-
[XML消息]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#xml-%E6%B6%88%E6%81%AF [xml 消息]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#xml-%E6%B6%88%E6%81%AF
[JSON消息]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#json-%E6%B6%88%E6%81%AF [json 消息]: https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#json-%E6%B6%88%E6%81%AF
#### 拓展 CQ 码及与 Onebot 标准有略微差异的 CQ 码
##### 拓展CQ码及与Onebot标准有略微差异的CQ码
| 拓展 CQ 码 | 功能 | | 拓展 CQ 码 | 功能 |
| -------------- | ------------------------------- | | -------------- | --------------------------------- |
| [CQ:image] | [图片] | | [CQ:image] | [图片] |
| [CQ:redbag] | [红包] | | [CQ:redbag] | [红包] |
| [CQ:poke] | [戳一戳] | | [CQ:poke] | [戳一戳] |
@ -79,7 +119,8 @@
<details> <details>
<summary>已实现API</summary> <summary>已实现API</summary>
##### 符合Onebot标准的API #### 符合 Onebot 标准的 API
| API | 功能 | | API | 功能 |
| ------------------------ | ---------------------- | | ------------------------ | ---------------------- |
| /send_private_msg | [发送私聊消息] | | /send_private_msg | [发送私聊消息] |
@ -110,7 +151,6 @@
| /set_restart | [重启 go-cqhttp] | | /set_restart | [重启 go-cqhttp] |
| /.handle_quick_operation | [对事件执行快速操作] | | /.handle_quick_operation | [对事件执行快速操作] |
[发送私聊消息]: https://github.com/howmanybots/onebot/blob/master/v11/specs/api/public.md#send_private_msg-%E5%8F%91%E9%80%81%E7%A7%81%E8%81%8A%E6%B6%88%E6%81%AF [发送私聊消息]: https://github.com/howmanybots/onebot/blob/master/v11/specs/api/public.md#send_private_msg-%E5%8F%91%E9%80%81%E7%A7%81%E8%81%8A%E6%B6%88%E6%81%AF
[发送群消息]: https://github.com/howmanybots/onebot/blob/master/v11/specs/api/public.md#send_group_msg-%E5%8F%91%E9%80%81%E7%BE%A4%E6%B6%88%E6%81%AF [发送群消息]: https://github.com/howmanybots/onebot/blob/master/v11/specs/api/public.md#send_group_msg-%E5%8F%91%E9%80%81%E7%BE%A4%E6%B6%88%E6%81%AF
[发送消息]: https://github.com/howmanybots/onebot/blob/master/v11/specs/api/public.md#send_msg-%E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF [发送消息]: https://github.com/howmanybots/onebot/blob/master/v11/specs/api/public.md#send_msg-%E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF
@ -139,7 +179,8 @@
[重启 go-cqhttp]: https://github.com/howmanybots/onebot/blob/master/v11/specs/api/public.md#set_restart-%E9%87%8D%E5%90%AF-onebot-%E5%AE%9E%E7%8E%B0 [重启 go-cqhttp]: https://github.com/howmanybots/onebot/blob/master/v11/specs/api/public.md#set_restart-%E9%87%8D%E5%90%AF-onebot-%E5%AE%9E%E7%8E%B0
[对事件执行快速操作]: https://github.com/howmanybots/onebot/blob/master/v11/specs/api/hidden.md#handle_quick_operation-%E5%AF%B9%E4%BA%8B%E4%BB%B6%E6%89%A7%E8%A1%8C%E5%BF%AB%E9%80%9F%E6%93%8D%E4%BD%9C [对事件执行快速操作]: https://github.com/howmanybots/onebot/blob/master/v11/specs/api/hidden.md#handle_quick_operation-%E5%AF%B9%E4%BA%8B%E4%BB%B6%E6%89%A7%E8%A1%8C%E5%BF%AB%E9%80%9F%E6%93%8D%E4%BD%9C
##### 拓展API及与Onebot标准有略微差异的API #### 拓展 API 及与 Onebot 标准有略微差异的 API
| 拓展 API | 功能 | | 拓展 API | 功能 |
| --------------------------- | ---------------------- | | --------------------------- | ---------------------- |
| /set_group_portrait | [设置群头像] | | /set_group_portrait | [设置群头像] |
@ -162,7 +203,7 @@
[获取合并转发内容]: docs/cqhttp.md#%E8%8E%B7%E5%8F%96%E5%90%88%E5%B9%B6%E8%BD%AC%E5%8F%91%E5%86%85%E5%AE%B9 [获取合并转发内容]: docs/cqhttp.md#%E8%8E%B7%E5%8F%96%E5%90%88%E5%B9%B6%E8%BD%AC%E5%8F%91%E5%86%85%E5%AE%B9
[发送合并转发(群)]: docs/cqhttp.md#%E5%8F%91%E9%80%81%E5%90%88%E5%B9%B6%E8%BD%AC%E5%8F%91%E7%BE%A4 [发送合并转发(群)]: docs/cqhttp.md#%E5%8F%91%E9%80%81%E5%90%88%E5%B9%B6%E8%BD%AC%E5%8F%91%E7%BE%A4
[获取中文分词]: docs/cqhttp.md#%E8%8E%B7%E5%8F%96%E4%B8%AD%E6%96%87%E5%88%86%E8%AF%8D [获取中文分词]: docs/cqhttp.md#%E8%8E%B7%E5%8F%96%E4%B8%AD%E6%96%87%E5%88%86%E8%AF%8D
[图片OCR]: docs/cqhttp.md#%E5%9B%BE%E7%89%87ocr [图片 ocr]: docs/cqhttp.md#%E5%9B%BE%E7%89%87ocr
[获取群系统消息]: docs/cqhttp.md#%E8%8E%B7%E5%8F%96%E7%BE%A4%E7%B3%BB%E7%BB%9F%E6%B6%88%E6%81%AF [获取群系统消息]: docs/cqhttp.md#%E8%8E%B7%E5%8F%96%E7%BE%A4%E7%B3%BB%E7%BB%9F%E6%B6%88%E6%81%AF
[获取群文件系统信息]: docs/cqhttp.md#%E8%8E%B7%E5%8F%96%E7%BE%A4%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF [获取群文件系统信息]: docs/cqhttp.md#%E8%8E%B7%E5%8F%96%E7%BE%A4%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF
[获取群根目录文件列表]: docs/cqhttp.md#%E8%8E%B7%E5%8F%96%E7%BE%A4%E6%A0%B9%E7%9B%AE%E5%BD%95%E6%96%87%E4%BB%B6%E5%88%97%E8%A1%A8 [获取群根目录文件列表]: docs/cqhttp.md#%E8%8E%B7%E5%8F%96%E7%BE%A4%E6%A0%B9%E7%9B%AE%E5%BD%95%E6%96%87%E4%BB%B6%E5%88%97%E8%A1%A8
@ -175,7 +216,8 @@
<details> <details>
<summary>已实现Event</summary> <summary>已实现Event</summary>
##### 符合Onebot标准的Event部分Event比Onebot标准多上报几个字段不影响使用 #### 符合 Onebot 标准的 Event部分 Event 比 Onebot 标准多上报几个字段,不影响使用)
| 事件类型 | Event | | 事件类型 | Event |
| -------- | ---------------- | | -------- | ---------------- |
| 消息事件 | [私聊信息] | | 消息事件 | [私聊信息] |
@ -210,7 +252,8 @@
[加好友请求]: https://github.com/howmanybots/onebot/blob/master/v11/specs/event/request.md#%E5%8A%A0%E5%A5%BD%E5%8F%8B%E8%AF%B7%E6%B1%82 [加好友请求]: https://github.com/howmanybots/onebot/blob/master/v11/specs/event/request.md#%E5%8A%A0%E5%A5%BD%E5%8F%8B%E8%AF%B7%E6%B1%82
[加群请求/邀请]: https://github.com/howmanybots/onebot/blob/master/v11/specs/event/request.md#%E5%8A%A0%E7%BE%A4%E8%AF%B7%E6%B1%82%E9%82%80%E8%AF%B7 [加群请求/邀请]: https://github.com/howmanybots/onebot/blob/master/v11/specs/event/request.md#%E5%8A%A0%E7%BE%A4%E8%AF%B7%E6%B1%82%E9%82%80%E8%AF%B7
##### 拓展Event #### 拓展 Event
| 事件类型 | 拓展 Event | | 事件类型 | 拓展 Event |
| -------- | ---------------- | | -------- | ---------------- |
| 通知事件 | [好友戳一戳] | | 通知事件 | [好友戳一戳] |
@ -223,9 +266,10 @@
</details> </details>
# 关于ISSUE ## 关于 ISSUE
以下 ISSUE 会被直接关闭 以下 ISSUE 会被直接关闭
- 提交 BUG 不使用 Template - 提交 BUG 不使用 Template
- 询问已知问题 - 询问已知问题
- 提问找不到重点 - 提问找不到重点
@ -233,6 +277,6 @@
> 请注意, 开发者并没有义务回复您的问题. 您应该具备基本的提问技巧。 > 请注意, 开发者并没有义务回复您的问题. 您应该具备基本的提问技巧。
# 性能 ## 性能
在关闭数据库的情况下, 加载 25 个好友 128 个群运行 24 小时后内存使用为 10MB 左右. 开启数据库后内存使用将根据消息量增加 10-20MB, 如果系统内存小于 128M 建议关闭数据库使用. 在关闭数据库的情况下, 加载 25 个好友 128 个群运行 24 小时后内存使用为 10MB 左右. 开启数据库后内存使用将根据消息量增加 10-20MB, 如果系统内存小于 128M 建议关闭数据库使用.