1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 19:43:49 +08:00

修复机器人已登录但继续尝试登录的缺陷

This commit is contained in:
千橘雫霞 2020-10-01 09:23:55 +08:00
parent 83ce4e58a5
commit f5f3a314eb

View File

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