mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-18 19:16:43 +00:00
Call .disconnect() on client.__del__ for convenience
This commit is contained in:
parent
b45b63d71d
commit
6cb5931e7a
@ -270,6 +270,9 @@ class TelegramBareClient:
|
|||||||
# TODO Shall we clear the _exported_sessions, or may be reused?
|
# TODO Shall we clear the _exported_sessions, or may be reused?
|
||||||
self._first_request = True # On reconnect it will be first again
|
self._first_request = True # On reconnect it will be first again
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
self.disconnect()
|
||||||
|
|
||||||
def _reconnect(self, new_dc=None):
|
def _reconnect(self, new_dc=None):
|
||||||
"""If 'new_dc' is not set, only a call to .connect() will be made
|
"""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
|
since it's assumed that the connection has been lost and the
|
||||||
|
Loading…
Reference in New Issue
Block a user