Allow adding update handlers without the need to poll updates

This commit is contained in:
Lonami Exo
2017-09-07 20:29:51 +02:00
parent b8e881b6b6
commit a24b4020fe
3 changed files with 32 additions and 11 deletions

View File

@@ -59,6 +59,7 @@ class TelegramBareClient:
connection_mode=ConnectionMode.TCP_FULL,
proxy=None,
enable_updates=False,
active_updates_polling=False,
timeout=timedelta(seconds=5)):
"""Initializes the Telegram client with the specified API ID and Hash.
Session must always be a Session instance, and an optional proxy
@@ -79,7 +80,7 @@ class TelegramBareClient:
# This member will process updates if enabled.
# One may change self.updates.enabled at any later point.
self.updates = UpdateState(enabled=enable_updates)
self.updates = UpdateState(enable_updates, active_updates_polling)
# These will be set later
self.dc_options = None