mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Accommodate Syncer
This commit is contained in:
parent
b84628e01d
commit
9631dc7780
@ -51,6 +51,7 @@ from pyrogram.session.internals import MsgId
|
|||||||
from . import utils
|
from . import utils
|
||||||
from .input_media import InputMedia
|
from .input_media import InputMedia
|
||||||
from .style import Markdown, HTML
|
from .style import Markdown, HTML
|
||||||
|
from .syncer import Syncer
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -232,6 +233,7 @@ class Client:
|
|||||||
Thread(target=self.download_worker, name="DownloadWorker#{}".format(i + 1)).start()
|
Thread(target=self.download_worker, name="DownloadWorker#{}".format(i + 1)).start()
|
||||||
|
|
||||||
mimetypes.init()
|
mimetypes.init()
|
||||||
|
Syncer.add(self)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
"""Use this method to manually stop the Client.
|
"""Use this method to manually stop the Client.
|
||||||
@ -252,6 +254,8 @@ class Client:
|
|||||||
for _ in range(self.DOWNLOAD_WORKERS):
|
for _ in range(self.DOWNLOAD_WORKERS):
|
||||||
self.download_queue.put(None)
|
self.download_queue.put(None)
|
||||||
|
|
||||||
|
Syncer.remove(self)
|
||||||
|
|
||||||
def authorize_bot(self):
|
def authorize_bot(self):
|
||||||
try:
|
try:
|
||||||
r = self.send(
|
r = self.send(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user