Simplify the workflow with UpdateState exposing a single flag param

This commit is contained in:
Lonami Exo
2017-09-08 12:54:38 +02:00
parent 25bbb20b0c
commit c81537bed0
4 changed files with 32 additions and 32 deletions

View File

@@ -58,8 +58,7 @@ class TelegramBareClient:
def __init__(self, session, api_id, api_hash,
connection_mode=ConnectionMode.TCP_FULL,
proxy=None,
enable_updates=False,
active_updates_polling=False,
process_updates=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
@@ -80,7 +79,7 @@ class TelegramBareClient:
# This member will process updates if enabled.
# One may change self.updates.enabled at any later point.
self.updates = UpdateState(enable_updates, active_updates_polling)
self.updates = UpdateState(process_updates)
# These will be set later
self.dc_options = None