Better document breaking ToS will lead to bans

Closes #4102.
This commit is contained in:
Lonami Exo 2023-05-04 19:05:07 +02:00
parent 2889bd5bf3
commit c4a41adae5
3 changed files with 28 additions and 3 deletions

View File

@ -12,6 +12,8 @@ as a user or through a bot account (bot API alternative).
If you have code using Telethon before its 1.0 version, you must If you have code using Telethon before its 1.0 version, you must
read `Compatibility and Convenience`_ to learn how to migrate. read `Compatibility and Convenience`_ to learn how to migrate.
As with any third-party library for Telegram, be careful not to
break `Telegram's ToS`_ or `Telegram can ban the account`_.
What is this? What is this?
------------- -------------
@ -76,6 +78,8 @@ useful information.
.. _MTProto: https://core.telegram.org/mtproto .. _MTProto: https://core.telegram.org/mtproto
.. _Telegram: https://telegram.org .. _Telegram: https://telegram.org
.. _Compatibility and Convenience: https://docs.telethon.dev/en/stable/misc/compatibility-and-convenience.html .. _Compatibility and Convenience: https://docs.telethon.dev/en/stable/misc/compatibility-and-convenience.html
.. _Telegram's ToS: https://core.telegram.org/api/terms
.. _Telegram can ban the account: https://docs.telethon.dev/en/stable/quick-references/faq.html#my-account-was-deleted-limited-when-using-the-library
.. _Read The Docs: https://docs.telethon.dev .. _Read The Docs: https://docs.telethon.dev
.. |logo| image:: logo.svg .. |logo| image:: logo.svg

View File

@ -60,6 +60,16 @@ And except them as such:
My account was deleted/limited when using the library My account was deleted/limited when using the library
===================================================== =====================================================
First and foremost, **this is not a problem exclusive to Telethon.
Any third-party library is prone to cause the accounts to appear banned.**
Even official applications can make Telegram ban an account under certain
circumstances. Third-party libraries such as Telethon are a lot easier to
use, and as such, they are misused to spam, which causes Telegram to learn
certain patterns and ban suspicious activity.
There is no point in Telethon trying to circumvent this. Even if it succeeded,
spammers would then abuse the library again, and the cycle would repeat.
The library will only do things that you tell it to do. If you use The library will only do things that you tell it to do. If you use
the library with bad intentions, Telegram will hopefully ban you. the library with bad intentions, Telegram will hopefully ban you.
@ -75,6 +85,16 @@ would fail. To solve these connection problems, you should use a proxy.
Telegram may also ban virtual (VoIP) phone numbers, Telegram may also ban virtual (VoIP) phone numbers,
as again, they're likely to be used for spam. as again, they're likely to be used for spam.
More recently (year 2023 onwards), Telegram has started putting a lot more
measures to prevent spam (with even additions such as anonymous participants
in groups or the inability to fetch group members at all). This means some
of the anti-spam measures have gotten more aggressive.
The recommendation has usually been to use the library only on well-established
accounts (and not an account you just created), and to not perform actions that
could be seen as abuse. Telegram decides what those actions are, and they're
free to change how they operate at any time.
If you want to check if your account has been limited, If you want to check if your account has been limited,
simply send a private message to `@SpamBot`_ through Telegram itself. simply send a private message to `@SpamBot`_ through Telegram itself.
You should notice this by getting errors like ``PeerFloodError``, You should notice this by getting errors like ``PeerFloodError``,

View File

@ -238,13 +238,14 @@ class AuthMethods:
me = await self.sign_in(phone=phone, password=password) me = await self.sign_in(phone=phone, password=password)
# We won't reach here if any step failed (exit by exception) # We won't reach here if any step failed (exit by exception)
signed, name = 'Signed in successfully as', utils.get_display_name(me) signed, name = 'Signed in successfully as ', utils.get_display_name(me)
tos = '; remember to not break the ToS or you will risk an account ban!'
try: try:
print(signed, name) print(signed, name, tos, sep='')
except UnicodeEncodeError: except UnicodeEncodeError:
# Some terminals don't support certain characters # Some terminals don't support certain characters
print(signed, name.encode('utf-8', errors='ignore') print(signed, name.encode('utf-8', errors='ignore')
.decode('ascii', errors='ignore')) .decode('ascii', errors='ignore'), tos, sep='')
return self return self