From 0cd479531815cdc744732a462faaa1462a60f225 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 23 Jun 2018 16:15:44 +0200 Subject: [PATCH] Use TOS provided by Telegram --- pyrogram/client/client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index a6250d74..4787c7af 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -199,8 +199,6 @@ class Client(Methods, BaseClient): self.is_started = True if self.user_id is None: - print(self.TOS) - if self.token is None: self.authorize_user() else: @@ -460,6 +458,9 @@ class Client(Methods, BaseClient): phone_code_hash = r.phone_code_hash terms_of_service = r.terms_of_service + if terms_of_service: + print("\n" + terms_of_service.text + "\n") + if self.force_sms: self.send( functions.auth.ResendCode( @@ -565,7 +566,8 @@ class Client(Methods, BaseClient): else: 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.user_id = r.user.id