From 8e2aec4d3acdcf8853709240e3b9622d7adb3056 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 7 Jun 2018 12:54:23 +0200 Subject: [PATCH] Show TOS on sign-ins --- pyrogram/client/client.py | 2 ++ pyrogram/client/ext/base_client.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 73f45966..b148c307 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -204,6 +204,8 @@ 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: diff --git a/pyrogram/client/ext/base_client.py b/pyrogram/client/ext/base_client.py index 9c0fb26b..8d2f4860 100644 --- a/pyrogram/client/ext/base_client.py +++ b/pyrogram/client/ext/base_client.py @@ -26,6 +26,16 @@ from ...session.internals import MsgId class BaseClient: + TOS = ( + "By using Pyrogram you accept Telegram's Terms of Service (https://telegram.org/tos) and agree not to:\n\n" + + "- Use the library to send spam or scam users.\n" + "- Promote violence on publicly viewable Telegram bots, groups or channels.\n" + "- Post illegal pornographic content on publicly viewable Telegram bots, groups or channels.\n\n" + + "We reserve the right to update these Terms of Service later.\n" + ) + INVITE_LINK_RE = re.compile(r"^(?:https?://)?(?:t\.me/joinchat/)([\w-]+)$") BOT_TOKEN_RE = re.compile(r"^\d+:[\w-]+$") DIALOGS_AT_ONCE = 100