mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 12:51:18 +00:00
Show TOS on signup just once while program is running (#231)
This commit is contained in:
parent
9d701bc226
commit
5aa93b8287
@ -181,6 +181,8 @@ class Client(Methods, BaseClient):
|
||||
Defaults to False (normal session).
|
||||
"""
|
||||
|
||||
terms_of_service_displayed = False
|
||||
|
||||
def __init__(self,
|
||||
session_name: str,
|
||||
api_id: Union[int, str] = None,
|
||||
@ -591,8 +593,9 @@ class Client(Methods, BaseClient):
|
||||
phone_code_hash = r.phone_code_hash
|
||||
terms_of_service = r.terms_of_service
|
||||
|
||||
if terms_of_service:
|
||||
if terms_of_service and not Client.terms_of_service_displayed:
|
||||
print("\n" + terms_of_service.text + "\n")
|
||||
Client.terms_of_service_displayed = True
|
||||
|
||||
if self.force_sms:
|
||||
self.send(
|
||||
|
Loading…
Reference in New Issue
Block a user