From 519e9c861310597de0a4e690e6426285082cb704 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 9 Dec 2017 17:09:39 +0100 Subject: [PATCH] Display notice only once --- pyrogram/session/session.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 12d0269d..75b67071 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -66,9 +66,13 @@ class Session: ACKS_THRESHOLD = 8 PING_INTERVAL = 5 + notice_displayed = False + def __init__(self, dc_id: int, test_mode: bool, auth_key: bytes, api_id: str): - print("Pyrogram v{}, {}".format(__version__, __copyright__)) - print("Licensed under the terms of the " + __license__) + if not Session.notice_displayed: + print("Pyrogram v{}, {}".format(__version__, __copyright__)) + print("Licensed under the terms of the " + __license__, end="\n\n") + Session.notice_displayed = True self.connection = Connection(DataCenter(dc_id, test_mode))