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

fix: block login process when account has been banned

This commit is contained in:
Mrs4s 2023-03-11 01:29:33 +08:00
parent 91facb54ce
commit 069f9d1335
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7

View File

@ -169,6 +169,8 @@ func loginResponseProcessor(res *client.LoginResponse) error {
if strings.Contains(text, "1") { if strings.Contains(text, "1") {
ticket := getTicket(res.VerifyUrl) ticket := getTicket(res.VerifyUrl)
if ticket == "" { if ticket == "" {
log.Infof("按 Enter 继续....")
readLine()
os.Exit(0) os.Exit(0)
} }
res, err = cli.SubmitTicket(ticket) res, err = cli.SubmitTicket(ticket)
@ -223,11 +225,14 @@ func loginResponseProcessor(res *client.LoginResponse) error {
case client.OtherLoginError, client.UnknownLoginError, client.TooManySMSRequestError: case client.OtherLoginError, client.UnknownLoginError, client.TooManySMSRequestError:
msg := res.ErrorMessage msg := res.ErrorMessage
if strings.Contains(msg, "冻结") { if strings.Contains(msg, "冻结") {
log.Fatalf("账号被冻结") log.Warnf("账号被冻结")
log.Infof("按 Enter 继续....")
readLine()
os.Exit(0)
} }
log.Warnf("登录失败: %v", msg) log.Warnf("登录失败: %v", msg)
log.Infof("按 Enter 或等待 5s 后继续....") log.Infof("按 Enter 继续....")
readLineTimeout(time.Second * 5) readLine()
os.Exit(0) os.Exit(0)
} }
} }