From 2779e33d1351a461ce3fc1d0f8a692360e4cc8e1 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 27 Aug 2018 02:11:07 +0200 Subject: [PATCH] Rename "token" to "bot_token" --- pyrogram/client/client.py | 8 ++++---- pyrogram/client/ext/base_client.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 3af60931..dba204fd 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -201,7 +201,7 @@ class Client(Methods, BaseClient): raise ConnectionError("Client has already been started") if self.BOT_TOKEN_RE.match(self.session_name): - self.token = self.session_name + self.bot_token = self.session_name self.session_name = self.session_name.split(":")[0] self.load_config() @@ -217,14 +217,14 @@ class Client(Methods, BaseClient): self.is_started = True if self.user_id is None: - if self.token is None: + if self.bot_token is None: self.authorize_user() else: self.authorize_bot() self.save_session() - if self.token is None: + if self.bot_token is None: now = time.time() if abs(now - self.date) > Client.OFFLINE_SLEEP: @@ -381,7 +381,7 @@ class Client(Methods, BaseClient): flags=0, api_id=self.api_id, api_hash=self.api_hash, - bot_auth_token=self.token + bot_auth_token=self.bot_token ) ) except UserMigrate as e: diff --git a/pyrogram/client/ext/base_client.py b/pyrogram/client/ext/base_client.py index c78997c1..fa96e1db 100644 --- a/pyrogram/client/ext/base_client.py +++ b/pyrogram/client/ext/base_client.py @@ -64,7 +64,7 @@ class BaseClient: } def __init__(self): - self.token = None + self.bot_token = None self.dc_id = None self.auth_key = None self.user_id = None