Skip to content

Commit

Permalink
chore: make lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 19, 2024
1 parent 852c5f2 commit c9939d1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions plugin/drawlots/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions plugin/mcfish/pole.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions plugin/warframeapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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))
Expand Down
8 changes: 4 additions & 4 deletions plugin/wenxinvilg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit c9939d1

Please sign in to comment.