MCPcopy
hub / github.com/eatmoreapple/openwechat / Logout

Method Logout

bot.go:100–110  ·  view source on GitHub ↗

Logout 用户退出

()

Source from the content-addressed store, hash-verified

98
99// Logout 用户退出
100func (b *Bot) Logout() error {
101 if b.Alive() {
102 info := b.Storage.LoginInfo
103 if err := b.Caller.Logout(b.Context(), info); err != nil {
104 return err
105 }
106 b.ExitWith(ErrUserLogout)
107 return nil
108 }
109 return errors.New("user not login")
110}
111
112// loginFromURL 登录逻辑
113func (b *Bot) loginFromURL(path *url.URL) error {

Callers 1

TestLogoutFunction · 0.45

Calls 3

AliveMethod · 0.95
ContextMethod · 0.95
ExitWithMethod · 0.95

Tested by 1

TestLogoutFunction · 0.36