fix 修复清理过期账号指令

This commit is contained in:
ZJY 2021-09-21 17:31:12 +08:00
parent a024976a40
commit a056351a03
2 changed files with 14 additions and 4 deletions

View File

@ -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)

View File

@ -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
},