mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 18:20:27 +00:00
✏️ 收集 max / min 到 data 包
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/wdvxdr1123/ZeroBot/message"
|
||||
|
||||
"github.com/FloatTech/ZeroBot-Plugin/control"
|
||||
"github.com/FloatTech/ZeroBot-Plugin/data"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -30,7 +31,7 @@ func init() {
|
||||
}).OnFullMatch("来份萝莉").SetBlock(true).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
go func() {
|
||||
for i := 0; i < min(cap(queue)-len(queue), 2); i++ {
|
||||
for i := 0; i < data.Min(cap(queue)-len(queue), 2); i++ {
|
||||
resp, err := http.Get(api)
|
||||
if err != nil {
|
||||
ctx.SendChain(message.Text("ERROR: ", err))
|
||||
@@ -60,10 +61,3 @@ func init() {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func min(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user