diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a5fc0bd..77b92f6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,6 +1,6 @@
name: CI
-on: [push, pull_request]
+on: [push, pull_request,workflow_dispatch]
env:
BINARY_PREFIX: "go-cqhttp_"
@@ -31,6 +31,13 @@ jobs:
uses: actions/setup-go@v2.1.3
with:
go-version: 1.16
+ - name: Cache downloaded module
+ uses: actions/cache@v2
+ with:
+ path: |
+ ~/.cache/go-build
+ ~/go/pkg/mod
+ key: ${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}-${{ hashFiles('**/go.sum') }}
- name: Build binary file
env:
GOOS: ${{ matrix.goos }}
diff --git a/.github/workflows/golint.yml b/.github/workflows/golint.yml
index 206a42c..4e03fff 100644
--- a/.github/workflows/golint.yml
+++ b/.github/workflows/golint.yml
@@ -1,6 +1,6 @@
name: Lint
-on: [push]
+on: [push,workflow_dispatch]
jobs:
golangci:
@@ -18,6 +18,14 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: latest
+
+ - name: Cache downloaded module
+ uses: actions/cache@v2
+ with:
+ path: |
+ ~/.cache/go-build
+ ~/go/pkg/mod
+ key: ${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}-${{ hashFiles('**/go.sum') }}
- name: Tests
run: |
diff --git a/.github/workflows/suggester.yml b/.github/workflows/suggester.yml
index b427f2f..a61f13b 100644
--- a/.github/workflows/suggester.yml
+++ b/.github/workflows/suggester.yml
@@ -18,6 +18,14 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: latest
+
+ - name: Cache downloaded module
+ uses: actions/cache@v2
+ with:
+ path: |
+ ~/.cache/go-build
+ ~/go/pkg/mod
+ key: ${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}-${{ hashFiles('**/go.sum') }}
- name: Tests
run: |
diff --git a/README.md b/README.md
index b80da92..cc8eb8a 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
-
+
+
+
@@ -42,14 +44,14 @@ _✨ 基于 [Mirai](https://github.com/mamoe/mirai) 以及 [MiraiGo](https://git
## 兼容性
-go-cqhttp兼容[OneBot-v11](https://github.com/howmanybots/onebot/tree/master/v11/specs)绝大多数内容,并在其基础上做了一些扩展,详情请看go-cqhttp的文档
+go-cqhttp 兼容 [OneBot-v11](https://github.com/howmanybots/onebot/tree/master/v11/specs) 绝大多数内容,并在其基础上做了一些扩展,详情请看 go-cqhttp 的文档。
### 接口
- [x] HTTP API
- [x] 反向 HTTP POST
-- [x] 正向 Websocket
-- [x] 反向 Websocket
+- [x] 正向 WebSocket
+- [x] 反向 WebSocket
### 拓展支持
@@ -66,9 +68,9 @@ go-cqhttp兼容[OneBot-v11](https://github.com/howmanybots/onebot/tree/master/v1
### 实现
-已实现CQ码
+已实现 CQ 码
-#### 符合 Onebot 标准的 CQ 码
+#### 符合 OneBot 标准的 CQ 码
| CQ 码 | 功能 |
| ------------ | --------------------------- |
@@ -97,7 +99,7 @@ go-cqhttp兼容[OneBot-v11](https://github.com/howmanybots/onebot/tree/master/v1
[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
-#### 拓展 CQ 码及与 Onebot 标准有略微差异的 CQ 码
+#### 拓展 CQ 码及与 OneBot 标准有略微差异的 CQ 码
| 拓展 CQ 码 | 功能 |
| -------------- | --------------------------------- |
@@ -120,9 +122,9 @@ go-cqhttp兼容[OneBot-v11](https://github.com/howmanybots/onebot/tree/master/v1
-已实现API
+已实现 API
-#### 符合 Onebot 标准的 API
+#### 符合 OneBot 标准的 API
| API | 功能 |
| ------------------------ | ---------------------- |
@@ -182,7 +184,7 @@ go-cqhttp兼容[OneBot-v11](https://github.com/howmanybots/onebot/tree/master/v1
[重启 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
-#### 拓展 API 及与 Onebot 标准有略微差异的 API
+#### 拓展 API 及与 OneBot 标准有略微差异的 API
| 拓展 API | 功能 |
| --------------------------- | ---------------------- |
@@ -217,9 +219,9 @@ go-cqhttp兼容[OneBot-v11](https://github.com/howmanybots/onebot/tree/master/v1
-已实现Event
+已实现 Event
-#### 符合 Onebot 标准的 Event(部分 Event 比 Onebot 标准多上报几个字段,不影响使用)
+#### 符合 OneBot 标准的 Event(部分 Event 比 OneBot 标准多上报几个字段,不影响使用)
| 事件类型 | Event |
| -------- | ---------------- |
@@ -285,4 +287,4 @@ go-cqhttp兼容[OneBot-v11](https://github.com/howmanybots/onebot/tree/master/v1
## 性能
-在关闭数据库的情况下, 加载 25 个好友 128 个群运行 24 小时后内存使用为 15MB 左右. 开启数据库后内存使用将根据消息量增加 10-20MB, 如果系统内存小于 128M 建议关闭数据库使用.
\ No newline at end of file
+在关闭数据库的情况下, 加载 25 个好友 128 个群运行 24 小时后内存使用为 15MB 左右. 开启数据库后内存使用将根据消息量增加 10-20MB, 如果系统内存小于 128M 建议关闭数据库使用.
diff --git a/login.go b/login.go
index 12690ef..f74469a 100644
--- a/login.go
+++ b/login.go
@@ -130,6 +130,7 @@ func loginResponseProcessor(res *client.LoginResponse) error {
continue
}
cli.Disconnect()
+ cli = client.NewClientEmpty()
return qrcodeLogin()
case client.NeedCaptcha:
log.Warnf("登录需要验证码.")