diff --git a/.github/workflows/golint.yml b/.github/workflows/golint.yml index 624634e..5a9ef49 100644 --- a/.github/workflows/golint.yml +++ b/.github/workflows/golint.yml @@ -37,4 +37,5 @@ jobs: if: ${{ github.event.pull_request }} uses: reviewdog/action-suggester@v1 with: + github_token: ${{ secrets.GITHUB_TOKEN }} tool_name: golangci-lint diff --git a/coolq/cqcode.go b/coolq/cqcode.go index eb6c8fd..80d5913 100644 --- a/coolq/cqcode.go +++ b/coolq/cqcode.go @@ -414,7 +414,7 @@ func ToMessageContent(e []message.IMessageElement) (r []global.MSG) { case *message.RedBagElement: m = global.MSG{ "type": "redbag", - "data": global.MSG{"title": o.Title, "type": o.MsgType}, + "data": global.MSG{"title": o.Title, "type": int(o.MsgType)}, } case *message.ForwardElement: m = global.MSG{ diff --git a/db/leveldb/leveldb.go b/db/leveldb/leveldb.go index 0236932..cfe7716 100644 --- a/db/leveldb/leveldb.go +++ b/db/leveldb/leveldb.go @@ -5,7 +5,6 @@ import ( "encoding/gob" "path" - "github.com/Mrs4s/MiraiGo/message" "github.com/Mrs4s/MiraiGo/utils" "github.com/Mrs4s/MiraiGo/binary" @@ -37,7 +36,6 @@ func init() { gob.Register(db.StoredGroupMessage{}) gob.Register(db.StoredPrivateMessage{}) gob.Register(db.StoredGuildChannelMessage{}) - gob.Register(message.RedBagMessageType(0)) db.Register("leveldb", func(node yaml.Node) db.Database { conf := new(config.LevelDBConfig) diff --git a/server/http.go b/server/http.go index dcde4f9..7d696c5 100644 --- a/server/http.go +++ b/server/http.go @@ -2,7 +2,6 @@ package server import ( "bytes" - "context" "crypto/hmac" "crypto/sha1" "encoding/hex" @@ -360,14 +359,3 @@ func (c *HTTPClient) onBotPushEvent(e *coolq.Event) { c.bot.CQHandleQuickOperation(gjson.Parse(e.JSONString()), gjson.ParseBytes(r)) } } - -func (s *httpServer) ShutDown() { - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - if err := s.HTTP.Shutdown(ctx); err != nil { - log.Fatal("http Server Shutdown:", err) - } - <-ctx.Done() - log.Println("timeout of 5 seconds.") - log.Println("http Server exiting") -}