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
4 changed files with 13 additions and 15 deletions

View File

@@ -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))]
}

View File

@@ -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 {

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,当前长度%.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
}