From 9631dc7780b4e59ce1159dc65f708cd408260f12 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 13 Apr 2018 15:21:34 +0200 Subject: [PATCH] Accommodate Syncer --- pyrogram/client/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index fce73875..c4376d46 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -51,6 +51,7 @@ from pyrogram.session.internals import MsgId from . import utils from .input_media import InputMedia from .style import Markdown, HTML +from .syncer import Syncer log = logging.getLogger(__name__) @@ -232,6 +233,7 @@ class Client: Thread(target=self.download_worker, name="DownloadWorker#{}".format(i + 1)).start() mimetypes.init() + Syncer.add(self) def stop(self): """Use this method to manually stop the Client. @@ -252,6 +254,8 @@ class Client: for _ in range(self.DOWNLOAD_WORKERS): self.download_queue.put(None) + Syncer.remove(self) + def authorize_bot(self): try: r = self.send(