Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pyrogram/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -591,8 +593,9 @@ def default_phone_number_callback():
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(
Expand Down