Call .disconnect() on client.__del__ for convenience

This commit is contained in:
Lonami Exo 2018-01-04 23:37:47 +01:00
parent b45b63d71d
commit 6cb5931e7a

View File

@ -270,6 +270,9 @@ class TelegramBareClient:
# TODO Shall we clear the _exported_sessions, or may be reused?
self._first_request = True # On reconnect it will be first again
def __del__(self):
self.disconnect()
def _reconnect(self, new_dc=None):
"""If 'new_dc' is not set, only a call to .connect() will be made
since it's assumed that the connection has been lost and the