chore(lint): 改进代码样式 (#968)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2024-08-30 18:04:14 +08:00 committed by GitHub
parent 7b45374310
commit ff62723e91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 15 deletions

View File

@ -113,10 +113,10 @@ import (
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativesetu" // 本地涩图 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nativesetu" // 本地涩图
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nbnhhsh" // 拼音首字母缩写释义工具 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nbnhhsh" // 拼音首字母缩写释义工具
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nihongo" // 日语语法学习 _ "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/novel" // 铅笔小说网搜索
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nsfw" // nsfw图片识别 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/nsfw" // nsfw图片识别
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/nwife" // 本地老婆 _ "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/omikuji" // 浅草寺求签
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/poker" // 抽扑克 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/poker" // 抽扑克
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/qqwife" // 一群一天一夫一妻制群老婆 _ "github.com/FloatTech/ZeroBot-Plugin/plugin/qqwife" // 一群一天一夫一妻制群老婆

View File

@ -3,16 +3,17 @@ package niuniu
import ( import (
"fmt" "fmt"
"math/rand"
"strconv"
"strings"
"time"
ctrl "github.com/FloatTech/zbpctrl" ctrl "github.com/FloatTech/zbpctrl"
"github.com/FloatTech/zbputils/control" "github.com/FloatTech/zbputils/control"
"github.com/FloatTech/zbputils/ctxext" "github.com/FloatTech/zbputils/ctxext"
zero "github.com/wdvxdr1123/ZeroBot" zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/extension/rate" "github.com/wdvxdr1123/ZeroBot/extension/rate"
"github.com/wdvxdr1123/ZeroBot/message" "github.com/wdvxdr1123/ZeroBot/message"
"math/rand"
"strconv"
"strings"
"time"
) )
var ( var (
@ -145,14 +146,14 @@ func init() {
ctx.SendChain(message.Text("你已经注册过了")) ctx.SendChain(message.Text("你已经注册过了"))
return return
} }
//获取初始长度 // 获取初始长度
long := db.randLength() long := db.randLength()
u := userInfo{ u := userInfo{
UID: uid, UID: uid,
Length: long, Length: long,
UserCount: 0, UserCount: 0,
} }
//添加数据进入表 // 添加数据进入表
err := db.insertniuniu(&u, gid) err := db.insertniuniu(&u, gid)
if err != nil { if err != nil {
err = db.createGIDTable(gid) err = db.createGIDTable(gid)
@ -241,4 +242,3 @@ func init() {
func randomChoice(options []string) string { func randomChoice(options []string) string {
return options[rand.Intn(len(options))] return options[rand.Intn(len(options))]
} }

View File

@ -2,15 +2,16 @@
package niuniu package niuniu
import ( import (
fcext "github.com/FloatTech/floatbox/ctxext"
sql "github.com/FloatTech/sqlite"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
"math/rand" "math/rand"
"sort" "sort"
"strconv" "strconv"
"sync" "sync"
"time" "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 { type model struct {

View File

@ -166,7 +166,6 @@ func applySkill(myLength, oppoLength float64, increaseLength1 bool) (string, flo
return fmt.Sprintf("哦吼!?你的牛牛在长大欸!长大了%.2fcm", reduce), myLength, oppoLength return fmt.Sprintf("哦吼!?你的牛牛在长大欸!长大了%.2fcm", reduce), myLength, oppoLength
} }
return fmt.Sprintf("你以绝对的长度让对方屈服了呢!你的长度增加%.2fcm,当前长度%.2fcm", reduce, myLength), myLength, oppoLength return fmt.Sprintf("你以绝对的长度让对方屈服了呢!你的长度增加%.2fcm,当前长度%.2fcm", reduce, myLength), myLength, oppoLength
} }
myLength -= reduce myLength -= reduce
oppoLength += 0.8 * 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", reduce), myLength, oppoLength
} }
return fmt.Sprintf("对方以绝对的长度让你屈服了呢!你的长度减少%.2fcm,当前长度%.2fcm", reduce, myLength), myLength, oppoLength return fmt.Sprintf("对方以绝对的长度让你屈服了呢!你的长度减少%.2fcm,当前长度%.2fcm", reduce, myLength), myLength, oppoLength
} }
// fence // fence
@ -189,4 +187,3 @@ func fence(rd float64) float64 {
func hitGlue(l float64) float64 { func hitGlue(l float64) float64 {
return rand.Float64() * math.Log2(l) / 2 return rand.Float64() * math.Log2(l) / 2
} }