Make run() run the event loop

This commit is contained in:
Dan 2018-06-22 13:39:29 +02:00
parent 2571bf0758
commit 5446801c14

View file

@ -294,8 +294,12 @@ class Client(Methods, BaseClient):
Raises:
:class:`Error <pyrogram.Error>`
"""
self.start()
self.idle()
asyncio.get_event_loop().run_until_complete(
asyncio.gather(
self.start(),
self.idle()
)
)
def add_handler(self, handler, group: int = 0):
"""Use this method to register an update handler.