mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Rename "token" to "bot_token"
This commit is contained in:
parent
ccc3cb0c87
commit
2779e33d13
@ -201,7 +201,7 @@ class Client(Methods, BaseClient):
|
|||||||
raise ConnectionError("Client has already been started")
|
raise ConnectionError("Client has already been started")
|
||||||
|
|
||||||
if self.BOT_TOKEN_RE.match(self.session_name):
|
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.session_name = self.session_name.split(":")[0]
|
||||||
|
|
||||||
self.load_config()
|
self.load_config()
|
||||||
@ -217,14 +217,14 @@ class Client(Methods, BaseClient):
|
|||||||
self.is_started = True
|
self.is_started = True
|
||||||
|
|
||||||
if self.user_id is None:
|
if self.user_id is None:
|
||||||
if self.token is None:
|
if self.bot_token is None:
|
||||||
self.authorize_user()
|
self.authorize_user()
|
||||||
else:
|
else:
|
||||||
self.authorize_bot()
|
self.authorize_bot()
|
||||||
|
|
||||||
self.save_session()
|
self.save_session()
|
||||||
|
|
||||||
if self.token is None:
|
if self.bot_token is None:
|
||||||
now = time.time()
|
now = time.time()
|
||||||
|
|
||||||
if abs(now - self.date) > Client.OFFLINE_SLEEP:
|
if abs(now - self.date) > Client.OFFLINE_SLEEP:
|
||||||
@ -381,7 +381,7 @@ class Client(Methods, BaseClient):
|
|||||||
flags=0,
|
flags=0,
|
||||||
api_id=self.api_id,
|
api_id=self.api_id,
|
||||||
api_hash=self.api_hash,
|
api_hash=self.api_hash,
|
||||||
bot_auth_token=self.token
|
bot_auth_token=self.bot_token
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
except UserMigrate as e:
|
except UserMigrate as e:
|
||||||
|
@ -64,7 +64,7 @@ class BaseClient:
|
|||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.token = None
|
self.bot_token = None
|
||||||
self.dc_id = None
|
self.dc_id = None
|
||||||
self.auth_key = None
|
self.auth_key = None
|
||||||
self.user_id = None
|
self.user_id = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user