fix 修复清理过期账号指令
This commit is contained in:
parent
a024976a40
commit
a056351a03
@ -142,6 +142,19 @@ func initCookie() {
|
||||
}()
|
||||
}
|
||||
|
||||
func cleanCookie() {
|
||||
cks := GetJdCookies()
|
||||
(&JdCookie{}).Push("开始清理过期账号")
|
||||
xx := 0
|
||||
for i := range cks {
|
||||
if cks[i].Available == False {
|
||||
xx++
|
||||
cks[i].Removes(cks[i])
|
||||
}
|
||||
}
|
||||
(&JdCookie{}).Push(fmt.Sprintf("所有CK清理,共%d个", xx))
|
||||
}
|
||||
|
||||
func updateCookie() {
|
||||
cks := GetJdCookies()
|
||||
l := len(cks)
|
||||
|
||||
@ -749,10 +749,7 @@ var codeSignals = []CodeSignal{
|
||||
Handle: func(sender *Sender) interface{} {
|
||||
sender.Reply(fmt.Sprintf("删除所有false账号,请慎用"))
|
||||
sender.handleJdCookies(func(ck *JdCookie) {
|
||||
if ck.Available == False {
|
||||
ck.Removes(ck)
|
||||
sender.Reply(fmt.Sprintf("已清理账号%s", ck.Nickname))
|
||||
}
|
||||
cleanCookie()
|
||||
})
|
||||
return nil
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user