Commit d4385437 authored by Mrs4s's avatar Mrs4s Committed by GitHub

Merge pull request #335 from qianjunakasumi/dev

修复机器人已登录但继续尝试登录的缺陷
parents 83ce4e58 f5f3a314
...@@ -303,10 +303,14 @@ func main() { ...@@ -303,10 +303,14 @@ func main() {
var times uint = 1 var times uint = 1
for { for {
if conf.ReLogin.MaxReloginTimes == 0 { if cli.Online {
} else if times > conf.ReLogin.MaxReloginTimes { log.Warn("Bot已登录")
return
}
if conf.ReLogin.MaxReloginTimes != 0 && times > conf.ReLogin.MaxReloginTimes {
break break
} }
log.Warnf("Bot已离线 (%v),将在 %v 秒后尝试重连. 重连次数:%v", log.Warnf("Bot已离线 (%v),将在 %v 秒后尝试重连. 重连次数:%v",
e.Message, conf.ReLogin.ReLoginDelay, times) e.Message, conf.ReLogin.ReLoginDelay, times)
times++ times++
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment