code: func (m *MMClient) Logout() error {
  	m.logger.Debugf("logout as %s (team: %s) on %s", m.Credentials.Login, m.Credentials.Team, m.Credentials.Server)
  	m.WsQuit = true
  	m.WsClient.Close()
  	m.WsClient.UnderlyingConn().Close()
  	if strings.Contains(m.Credentials.Pass, model.SESSION_COOKIE_TOKEN) {
  		m.logger.Debug("Not invalidating session in logout, credential is a token")
  		return nil
  	}
  	_, resp := m.Client.Logout()
  	if resp.Error != nil {
  		return resp.Error
  	}
  	return nil
  }
docs: // Logout disconnects the client from the chat server.