mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-18 20:50:12 +08:00
chore: make lint happy
This commit is contained in:
parent
852c5f2f35
commit
c9939d145b
@ -252,17 +252,17 @@ func randGif(gifName string, uid int64) (image.Image, error) {
|
||||
// https://zhuanlan.zhihu.com/p/27718135
|
||||
rect := image.Rect(0, 0, config.Width, config.Height)
|
||||
if rect.Min == rect.Max {
|
||||
var max image.Point
|
||||
var maxP image.Point
|
||||
for _, frame := range im.Image {
|
||||
maxF := frame.Bounds().Max
|
||||
if max.X < maxF.X {
|
||||
max.X = maxF.X
|
||||
if maxP.X < maxF.X {
|
||||
maxP.X = maxF.X
|
||||
}
|
||||
if max.Y < maxF.Y {
|
||||
max.Y = maxF.Y
|
||||
if maxP.Y < maxF.Y {
|
||||
maxP.Y = maxF.Y
|
||||
}
|
||||
}
|
||||
rect.Max = max
|
||||
rect.Max = maxP
|
||||
}
|
||||
img := image.NewRGBA(rect)
|
||||
b := fcext.RandSenderPerDayN(uid, len(im.Image)) + 1
|
||||
|
||||
@ -361,12 +361,12 @@ func init() {
|
||||
ctx.SendChain(message.Text("[ERROR at pole.go.10]:", err))
|
||||
return
|
||||
}
|
||||
max := len(articles)
|
||||
if max < 3 {
|
||||
maxCount := len(articles)
|
||||
if maxCount < 3 {
|
||||
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("你的合成材料不足"))
|
||||
return
|
||||
}
|
||||
poles := make([]equip, 0, max)
|
||||
poles := make([]equip, 0, maxCount)
|
||||
for _, info := range articles {
|
||||
poleInfo := strings.Split(info.Other, "/")
|
||||
durable, _ := strconv.Atoi(poleInfo[0])
|
||||
@ -447,8 +447,8 @@ func init() {
|
||||
ctx.SendChain(message.At(ctx.Event.UserID), message.Text("[0]请输入正确的序号\n", list))
|
||||
continue
|
||||
}
|
||||
if first >= max || second >= max || third >= max {
|
||||
ctx.SendChain(message.At(ctx.Event.UserID), message.Text("[", max, "]请输入正确的序号\n", list))
|
||||
if first >= maxCount || second >= maxCount || third >= maxCount {
|
||||
ctx.SendChain(message.At(ctx.Event.UserID), message.Text("[", maxCount, "]请输入正确的序号\n", list))
|
||||
continue
|
||||
}
|
||||
check = true
|
||||
|
||||
@ -321,9 +321,9 @@ func init() {
|
||||
}
|
||||
|
||||
ismod := iteminfo.ModMaxRank != 0
|
||||
max := 5
|
||||
if len(sells) < max {
|
||||
max = len(sells)
|
||||
maxCount := 5
|
||||
if len(sells) < maxCount {
|
||||
maxCount = len(sells)
|
||||
}
|
||||
sb := strings.Builder{}
|
||||
if ismod {
|
||||
@ -332,13 +332,13 @@ func init() {
|
||||
} else {
|
||||
msgs = append(msgs, ctxext.FakeSenderForwardNode(ctx, message.Text("请输入编号选择(30s内)\n输入c直接结束会话")))
|
||||
}
|
||||
for i := 0; i < max; i++ {
|
||||
for i := 0; i < maxCount; i++ {
|
||||
// msgs = append(msgs, ctxext.FakeSenderForwardNode(ctx,
|
||||
// message.Text(fmt.Sprintf("[%d] (Rank:%d/%d) %dP - %s\n", i, sells[i].ModRank, iteminfo.ModMaxRank, sells[i].Platinum, sells[i].User.IngameName))))
|
||||
sb.WriteString(fmt.Sprintf("[%d] (Rank:%d/%d) %dP - %s\n", i, sells[i].ModRank, iteminfo.ModMaxRank, sells[i].Platinum, sells[i].User.IngameName))
|
||||
}
|
||||
} else {
|
||||
for i := 0; i < max; i++ {
|
||||
for i := 0; i < maxCount; i++ {
|
||||
// msgs = append(msgs, ctxext.FakeSenderForwardNode(ctx,
|
||||
// message.Text(fmt.Sprintf("[%d] %dP -%s\n", i, sells[i].Platinum, sells[i].User.IngameName))))
|
||||
sb.WriteString(fmt.Sprintf("[%d] %dP -%s\n", i, sells[i].Platinum, sells[i].User.IngameName))
|
||||
|
||||
@ -415,14 +415,14 @@ func init() { // 插件主体
|
||||
minlen := 1
|
||||
maxlen := 128
|
||||
if mun != "" {
|
||||
max, err := strconv.Atoi(mun)
|
||||
maxNum, err := strconv.Atoi(mun)
|
||||
if err != nil {
|
||||
ctx.SendChain(message.Text(modelErr, err))
|
||||
return
|
||||
}
|
||||
minlen = max
|
||||
if max > 128 {
|
||||
maxlen = max
|
||||
minlen = maxNum
|
||||
if maxNum > 128 {
|
||||
maxlen = maxNum
|
||||
}
|
||||
}
|
||||
keyword := ctx.State["regex_matched"].([]string)[4]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user