mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 20:59:29 +00:00
Use TOS provided by Telegram
This commit is contained in:
parent
602f4581c6
commit
0cd4795318
@ -199,8 +199,6 @@ class Client(Methods, BaseClient):
|
|||||||
self.is_started = True
|
self.is_started = True
|
||||||
|
|
||||||
if self.user_id is None:
|
if self.user_id is None:
|
||||||
print(self.TOS)
|
|
||||||
|
|
||||||
if self.token is None:
|
if self.token is None:
|
||||||
self.authorize_user()
|
self.authorize_user()
|
||||||
else:
|
else:
|
||||||
@ -460,6 +458,9 @@ class Client(Methods, BaseClient):
|
|||||||
phone_code_hash = r.phone_code_hash
|
phone_code_hash = r.phone_code_hash
|
||||||
terms_of_service = r.terms_of_service
|
terms_of_service = r.terms_of_service
|
||||||
|
|
||||||
|
if terms_of_service:
|
||||||
|
print("\n" + terms_of_service.text + "\n")
|
||||||
|
|
||||||
if self.force_sms:
|
if self.force_sms:
|
||||||
self.send(
|
self.send(
|
||||||
functions.auth.ResendCode(
|
functions.auth.ResendCode(
|
||||||
@ -565,7 +566,8 @@ class Client(Methods, BaseClient):
|
|||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
assert self.send(functions.help.AcceptTermsOfService(terms_of_service.id))
|
if terms_of_service:
|
||||||
|
assert self.send(functions.help.AcceptTermsOfService(terms_of_service.id))
|
||||||
|
|
||||||
self.password = None
|
self.password = None
|
||||||
self.user_id = r.user.id
|
self.user_id = r.user.id
|
||||||
|
Loading…
Reference in New Issue
Block a user