加速word count

This commit is contained in:
源文雨
2022-04-28 23:15:27 +08:00
parent 0e8bef0541
commit 136e6bddf4
10 changed files with 65 additions and 63 deletions

View File

@@ -349,11 +349,7 @@ func init() { // 插件主体
engine.OnFullMatchGroup([]string{"翻牌"}, zero.OnlyGroup).SetBlock(true).Limit(ctxext.LimitByUser).
Handle(func(ctx *zero.Ctx) {
// 无缓存获取群员列表
list := ctx.CallAction("get_group_member_list", zero.Params{
"group_id": ctx.Event.GroupID,
"no_cache": true,
}).Data
temp := list.Array()
temp := ctx.GetThisGroupMemberListNoCache().Array()
sort.SliceStable(temp, func(i, j int) bool {
return temp[i].Get("last_sent_time").Int() < temp[j].Get("last_sent_time").Int()
})