1
0
forked from x/ContextOS

add prune all

This commit is contained in:
shaoying 2019-12-04 23:35:23 +08:00
parent ebb7b9d369
commit f153effe97

View File

@ -440,11 +440,11 @@ var Index = &ctx.Context{Name: "code", Help: "代码中心",
} }
return return
}}, }},
"prune": {Name: "prune type sid...", Help: "清理", Hand: func(m *ctx.Message, c *ctx.Context, cmd string, arg ...string) (e error) { "prune": {Name: "prune type all|sid...", Help: "清理", Hand: func(m *ctx.Message, c *ctx.Context, cmd string, arg ...string) (e error) {
ps := arg[1:] ps := arg[1:]
if len(ps) == 0 { if len(ps) == 0 || ps[0] == "all" {
m.Confm("login", "hash", func(key string, value map[string]interface{}) { m.Confm("login", "hash", func(key string, value map[string]interface{}) {
if value["type"] == arg[0] && kit.Format(value["status"]) == "logout" { if value["type"] == arg[0] && (kit.Format(value["status"]) == "logout" || len(ps) > 0) {
ps = append(ps, key) ps = append(ps, key)
} }
}) })