fix a problem with Logout
This commit is contained in:
parent
e44cf1e557
commit
e07a798a08
3
bot.go
3
bot.go
@ -70,6 +70,7 @@ func (b *Bot) Login() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bot) Logout() error {
|
func (b *Bot) Logout() error {
|
||||||
|
if b.Alive() {
|
||||||
info := b.storage.GetLoginInfo()
|
info := b.storage.GetLoginInfo()
|
||||||
if err := b.Caller.Logout(info); err != nil {
|
if err := b.Caller.Logout(info); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -77,6 +78,8 @@ func (b *Bot) Logout() error {
|
|||||||
b.stopAsyncCALL(errors.New("logout"))
|
b.stopAsyncCALL(errors.New("logout"))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
return errors.New("user not login")
|
||||||
|
}
|
||||||
|
|
||||||
// 登录逻辑
|
// 登录逻辑
|
||||||
func (b *Bot) login(data []byte) error {
|
func (b *Bot) login(data []byte) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user