fix a problem with Logout

This commit is contained in:
ivy1996-encode 2021-03-16 18:00:30 +08:00
parent e44cf1e557
commit e07a798a08

13
bot.go
View File

@ -70,12 +70,15 @@ func (b *Bot) Login() error {
} }
func (b *Bot) Logout() error { func (b *Bot) Logout() error {
info := b.storage.GetLoginInfo() if b.Alive() {
if err := b.Caller.Logout(info); err != nil { info := b.storage.GetLoginInfo()
return err if err := b.Caller.Logout(info); err != nil {
return err
}
b.stopAsyncCALL(errors.New("logout"))
return nil
} }
b.stopAsyncCALL(errors.New("logout")) return errors.New("user not login")
return nil
} }
// 登录逻辑 // 登录逻辑