mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 02:00:24 +00:00
✏️ 分离 data
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
timer "github.com/FloatTech/ZeroBot-Plugin-Timer"
|
||||
|
||||
"github.com/FloatTech/ZeroBot-Plugin/data"
|
||||
"github.com/FloatTech/ZeroBot-Plugin/utils/math"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -302,7 +302,7 @@ func init() { // 插件主体
|
||||
sort.SliceStable(temp, func(i, j int) bool {
|
||||
return temp[i].Get("last_sent_time").Int() < temp[j].Get("last_sent_time").Int()
|
||||
})
|
||||
temp = temp[data.Max(0, len(temp)-10):]
|
||||
temp = temp[math.Max(0, len(temp)-10):]
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
who := temp[rand.Intn(len(temp))]
|
||||
if who.Get("user_id").Int() == ctx.Event.SelfID {
|
||||
|
||||
Reference in New Issue
Block a user