From 9d5718d8201e368b60cf0c32b5156da1043dd71c Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Wed, 29 Sep 2021 15:31:32 +0800 Subject: [PATCH] =?UTF-8?q?add=20QQ=E6=89=AB=E7=A0=81=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/command.go | 1 - qbot/main.go | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/models/command.go b/models/command.go index dd4c789..87f0d77 100644 --- a/models/command.go +++ b/models/command.go @@ -155,7 +155,6 @@ var codeSignals = []CodeSignal{ } logs.Info(s.Data.QqLoginQrcode.Bytes) //ddd, _ := base64.StdEncoding.DecodeString("data:image/png;base64,"+s.Data.QqLoginQrcode.Bytes) - return "data:image/png;base64," + s.Data.QqLoginQrcode.Bytes }, }, diff --git a/qbot/main.go b/qbot/main.go index aca4b26..07cacd8 100644 --- a/qbot/main.go +++ b/qbot/main.go @@ -9,6 +9,7 @@ import ( "encoding/hex" "flag" "fmt" + "github.com/beego/beego/v2/core/logs" "io/ioutil" "net/http" "os" @@ -77,12 +78,7 @@ func Main() { if bot != nil { if strings.Contains(msg.(string), "data:image") { photo := msg.(string) - //i := strings.Index(photo, ",") - //if i < 0 { - // log.Fatal("no comma") - //} - // - //dec := base64.NewDecoder(base64.StdEncoding, strings.NewReader(photo[i+1:])) + logs.Info(photo) b := []byte(photo) bot.SendPrivateMessage(uid, models.Config.QQGroupID, &message.SendingMessage{Elements: []message.IMessageElement{&coolq.LocalImageElement{Stream: bytes.NewReader(b)}}}) } else {