From 7ab0de5edb0e225f9658b12e975407a17ac81f27 Mon Sep 17 00:00:00 2001 From: icarus-ai <82353054+icarus-ai@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:34:51 +0800 Subject: [PATCH] fix: login.SubmitCaptcha & fmt & update (#14) * fix: login.SubmitCaptcha & fmt * fix: login.SubmitCaptcha & fmt --- cmd/gocq/login.go | 10 ++++------ coolq/event.go | 11 ++++------- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/cmd/gocq/login.go b/cmd/gocq/login.go index 5b153bfed..6d2f0df9a 100644 --- a/cmd/gocq/login.go +++ b/cmd/gocq/login.go @@ -13,13 +13,11 @@ import ( "github.com/Mrs4s/go-cqhttp/internal/download" - "github.com/LagrangeDev/LagrangeGo/utils" - - "github.com/LagrangeDev/LagrangeGo/client/packets/wtlogin/qrcodestate" - + "github.com/LagrangeDev/LagrangeGo/client" "github.com/LagrangeDev/LagrangeGo/client/auth" + "github.com/LagrangeDev/LagrangeGo/client/packets/wtlogin/qrcodestate" + "github.com/LagrangeDev/LagrangeGo/utils" - "github.com/LagrangeDev/LagrangeGo/client" "github.com/mattn/go-colorable" "github.com/pkg/errors" log "github.com/sirupsen/logrus" @@ -209,7 +207,7 @@ func loginResponseProcessor(res *client.LoginResponse) error { readLine() os.Exit(0) } - res, err = cli.SubmitCaptcha(strings.Split(strings.Split(res.VerifyURL, "sid=")[1], "&")[0], ticket, randStr) + res, err = cli.SubmitCaptcha(ticket, randStr, strings.Split(strings.Split(res.VerifyURL, "sid=")[1], "&")[0]) continue //case client.NeedCaptcha: // log.Warnf("登录需要验证码.") diff --git a/coolq/event.go b/coolq/event.go index d00d47f2c..e08b6b1a6 100644 --- a/coolq/event.go +++ b/coolq/event.go @@ -8,16 +8,13 @@ import ( "strconv" "strings" - "github.com/LagrangeDev/LagrangeGo/utils/binary" + log "github.com/sirupsen/logrus" + "github.com/LagrangeDev/LagrangeGo/client" "github.com/LagrangeDev/LagrangeGo/client/entity" - event2 "github.com/LagrangeDev/LagrangeGo/client/event" - "github.com/LagrangeDev/LagrangeGo/message" - - "github.com/LagrangeDev/LagrangeGo/client" - log "github.com/sirupsen/logrus" + "github.com/LagrangeDev/LagrangeGo/utils/binary" "github.com/Mrs4s/go-cqhttp/db" "github.com/Mrs4s/go-cqhttp/global" @@ -569,7 +566,7 @@ func (bot *CQBot) checkMedia(e []message.IMessageElement, source message.Source) }) filename := hex.EncodeToString(i.Md5) + ".video" cache.Video.Insert(i.Md5, data) - i.URL, _ = bot.Client.GetVideoURL(source.SourceType == message.SourceGroup, i) + i.URL, _ = bot.Client.GetVideoURL(source.SourceType == message.SourceGroup, i.UUID) i.Name = filename } } diff --git a/go.mod b/go.mod index 3df8aecf8..db060f8bb 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/FloatTech/sqlite v1.6.3 - github.com/LagrangeDev/LagrangeGo v0.1.2-0.20241114034146-304fa373b532 + github.com/LagrangeDev/LagrangeGo v0.0.0-20241114153145-593cc9695c20 github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7 github.com/RomiChan/websocket v1.4.3-0.20220227141055-9b2c6168c9c5 diff --git a/go.sum b/go.sum index 7d8c36c6b..3bbc29cfb 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/FloatTech/sqlite v1.6.3 h1:MQkqBNlkPuCoKQQgoNLuTL/2Ci3tBTFAnVYBdD0Wy4 github.com/FloatTech/sqlite v1.6.3/go.mod h1:zFbHzRfB+CJ+VidfjuVbrcin3DAz283F7hF1hIeHzpY= github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 h1:g4pTnDJUW4VbJ9NvoRfUvdjDrHz/6QhfN/LoIIpICbo= github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1/go.mod h1:fHZFWGquNXuHttu9dUYoKuNbm3dzLETnIOnm1muSfDs= -github.com/LagrangeDev/LagrangeGo v0.1.2-0.20241114034146-304fa373b532 h1:fcNkzgqc31OKtBm19XyT6GXKF/OvH9bWvmiUKKENjTM= -github.com/LagrangeDev/LagrangeGo v0.1.2-0.20241114034146-304fa373b532/go.mod h1:m7ydyvA8DKOg5c6iTFDfNtfIK9uhqXVJKRXl4mlGkTA= +github.com/LagrangeDev/LagrangeGo v0.0.0-20241114153145-593cc9695c20 h1:lmRVigl2YEk2ww3HirJ305vudIC0vYLVpvSSHdP33w8= +github.com/LagrangeDev/LagrangeGo v0.0.0-20241114153145-593cc9695c20/go.mod h1:m7ydyvA8DKOg5c6iTFDfNtfIK9uhqXVJKRXl4mlGkTA= github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a h1:aU1703IHxupjzipvhu16qYKLMR03e+8WuNR+JMsKfGU= github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a/go.mod h1:OZqLNXdYJHmx7aqq/T6wAdFEdoGm5nmIfC4kU7M8P8o= github.com/RomiChan/protobuf v0.1.1-0.20230204044148-2ed269a2e54d h1:/Xuj3fIiMY2ls1TwvPKmaqQrtJsPY+c9s+0lOScVHd8=