From ff62723e910478977bbac8812e23ce1d8dfa5703 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 18:04:14 +0800 Subject: [PATCH] =?UTF-8?q?chore(lint):=20=E6=94=B9=E8=BF=9B=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=B7=E5=BC=8F=20(#968)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- main.go | 2 +- plugin/niuniu/main.go | 14 +++++++------- plugin/niuniu/model.go | 9 +++++---- plugin/niuniu/utils.go | 3 --- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/main.go b/main.go index 66f5d2b8..2a95f0b6 100644 --- a/main.go +++ b/main.go @@ -113,10 +113,10 @@ import ( _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativesetu" // 本地涩图 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nbnhhsh" // 拼音首字母缩写释义工具 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nihongo" // 日语语法学习 + _ "github.com/FloatTech/ZeroBot-Plugin/plugin/niuniu" // 牛牛大作战 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/novel" // 铅笔小说网搜索 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nsfw" // nsfw图片识别 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nwife" // 本地老婆 - _ "github.com/FloatTech/ZeroBot-Plugin/plugin/niuniu" // 牛牛大作战 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/omikuji" // 浅草寺求签 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/poker" // 抽扑克 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/qqwife" // 一群一天一夫一妻制群老婆 diff --git a/plugin/niuniu/main.go b/plugin/niuniu/main.go index 5d04b218..8d75b9d5 100644 --- a/plugin/niuniu/main.go +++ b/plugin/niuniu/main.go @@ -3,16 +3,17 @@ package niuniu import ( "fmt" + "math/rand" + "strconv" + "strings" + "time" + ctrl "github.com/FloatTech/zbpctrl" "github.com/FloatTech/zbputils/control" "github.com/FloatTech/zbputils/ctxext" zero "github.com/wdvxdr1123/ZeroBot" "github.com/wdvxdr1123/ZeroBot/extension/rate" "github.com/wdvxdr1123/ZeroBot/message" - "math/rand" - "strconv" - "strings" - "time" ) var ( @@ -145,14 +146,14 @@ func init() { ctx.SendChain(message.Text("你已经注册过了")) return } - //获取初始长度 + // 获取初始长度 long := db.randLength() u := userInfo{ UID: uid, Length: long, UserCount: 0, } - //添加数据进入表 + // 添加数据进入表 err := db.insertniuniu(&u, gid) if err != nil { err = db.createGIDTable(gid) @@ -241,4 +242,3 @@ func init() { func randomChoice(options []string) string { return options[rand.Intn(len(options))] } - diff --git a/plugin/niuniu/model.go b/plugin/niuniu/model.go index 0f7462b1..153335e0 100644 --- a/plugin/niuniu/model.go +++ b/plugin/niuniu/model.go @@ -2,15 +2,16 @@ package niuniu import ( - fcext "github.com/FloatTech/floatbox/ctxext" - sql "github.com/FloatTech/sqlite" - zero "github.com/wdvxdr1123/ZeroBot" - "github.com/wdvxdr1123/ZeroBot/message" "math/rand" "sort" "strconv" "sync" "time" + + fcext "github.com/FloatTech/floatbox/ctxext" + sql "github.com/FloatTech/sqlite" + zero "github.com/wdvxdr1123/ZeroBot" + "github.com/wdvxdr1123/ZeroBot/message" ) type model struct { diff --git a/plugin/niuniu/utils.go b/plugin/niuniu/utils.go index 77575e5f..85a7ff89 100644 --- a/plugin/niuniu/utils.go +++ b/plugin/niuniu/utils.go @@ -166,7 +166,6 @@ func applySkill(myLength, oppoLength float64, increaseLength1 bool) (string, flo return fmt.Sprintf("哦吼!?你的牛牛在长大欸!长大了%.2fcm!", reduce), myLength, oppoLength } return fmt.Sprintf("你以绝对的长度让对方屈服了呢!你的长度增加%.2fcm,当前长度%.2fcm!", reduce, myLength), myLength, oppoLength - } myLength -= reduce oppoLength += 0.8 * reduce @@ -174,7 +173,6 @@ func applySkill(myLength, oppoLength float64, increaseLength1 bool) (string, flo return fmt.Sprintf("哦吼!?看来你的牛牛因为击剑而凹进去了呢🤣🤣🤣!凹进去了%.2fcm!", reduce), myLength, oppoLength } return fmt.Sprintf("对方以绝对的长度让你屈服了呢!你的长度减少%.2fcm,当前长度%.2fcm!", reduce, myLength), myLength, oppoLength - } // fence @@ -189,4 +187,3 @@ func fence(rd float64) float64 { func hitGlue(l float64) float64 { return rand.Float64() * math.Log2(l) / 2 } -