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

Merge pull request #335 from qianjunakasumi/dev

修复机器人已登录但继续尝试登录的缺陷
This commit is contained in:
Mrs4s 2020-10-01 11:40:13 +08:00 committed by GitHub
commit d438543746
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -303,10 +303,14 @@ func main() {
var times uint = 1
for {
if conf.ReLogin.MaxReloginTimes == 0 {
} else if times > conf.ReLogin.MaxReloginTimes {
if cli.Online {
log.Warn("Bot已登录")
return
}
if conf.ReLogin.MaxReloginTimes != 0 && times > conf.ReLogin.MaxReloginTimes {
break
}
log.Warnf("Bot已离线 (%v),将在 %v 秒后尝试重连. 重连次数:%v",
e.Message, conf.ReLogin.ReLoginDelay, times)
times++