From 9b4494a24f82926c3d901d91a31d213dd79fe171 Mon Sep 17 00:00:00 2001 From: fumiama Date: Wed, 12 Jan 2022 12:25:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=20fix=20new=20user=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin_score/sign_in.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/plugin_score/sign_in.go b/plugin_score/sign_in.go index d7582464..7aa9250b 100644 --- a/plugin_score/sign_in.go +++ b/plugin_score/sign_in.go @@ -48,10 +48,7 @@ func init() { si := sdb.GetSignInByUID(uid) siUpdateTimeStr := si.UpdatedAt.Format("20060102") if siUpdateTimeStr != today { - if err := sdb.InsertOrUpdateSignInCountByUID(uid, 0); err != nil { - ctx.SendChain(message.Text("ERROR:", err)) - return - } + _ = sdb.InsertOrUpdateSignInCountByUID(uid, 0) } drawedFile := cachePath + strconv.FormatInt(uid, 10) + today + "signin.png" @@ -66,10 +63,8 @@ func init() { picFile := cachePath + strconv.FormatInt(uid, 10) + today + ".png" initPic(picFile) - if err := sdb.InsertOrUpdateSignInCountByUID(uid, si.Count+1); err != nil { - ctx.SendChain(message.Text("ERROR:", err)) - return - } + _ = sdb.InsertOrUpdateSignInCountByUID(uid, si.Count+1) + back, err := gg.LoadImage(picFile) if err != nil { ctx.SendChain(message.Text("ERROR:", err)) @@ -102,10 +97,7 @@ func init() { score = SCOREMAX ctx.SendChain(message.At(uid), message.Text("你获得的小熊饼干已经达到上限")) } - if err := sdb.InsertOrUpdateScoreByUID(uid, score); err != nil { - ctx.SendChain(message.Text("ERROR:", err)) - return - } + _ = sdb.InsertOrUpdateScoreByUID(uid, score) level := getLevel(score) canvas.DrawString("当前小熊饼干:"+strconv.FormatInt(int64(score), 10), float64(back.Bounds().Size().X)*0.1, float64(back.Bounds().Size().Y)*1.4) canvas.DrawString("LEVEL:"+strconv.FormatInt(int64(level), 10), float64(back.Bounds().Size().X)*0.1, float64(back.Bounds().Size().Y)*1.5)