diff --git a/readthedocs/extra/advanced-usage/accessing-the-full-api.rst b/readthedocs/extra/advanced-usage/accessing-the-full-api.rst index 659af4b7..31efa51c 100644 --- a/readthedocs/extra/advanced-usage/accessing-the-full-api.rst +++ b/readthedocs/extra/advanced-usage/accessing-the-full-api.rst @@ -11,10 +11,10 @@ Accessing the Full API reason not to, like a method not existing or you wanting more control. -The ``TelegramClient`` doesn't offer a method for every single request -the Telegram API supports. However, it's very simple to *call* or *invoke* -any request. Whenever you need something, don't forget to `check the -documentation`__ and look for the `method you need`__. There you can go +The `telethon.telegram_client.TelegramClient` doesn't offer a method for every +single request the Telegram API supports. However, it's very simple to *call* +or *invoke* any request. Whenever you need something, don't forget to `check +the documentation`__ and look for the `method you need`__. There you can go through a sorted list of everything you can do. @@ -30,9 +30,9 @@ You should also refer to the documentation to see what the objects (constructors) Telegram returns look like. Every constructor inherits from a common type, and that's the reason for this distinction. -Say ``client.send_message()`` didn't exist, we could use the `search`__ -to look for "message". There we would find :tl:`SendMessageRequest`, -which we can work with. +Say `telethon.telegram_client.TelegramClient.send_message` didn't exist, +we could use the `search`__ to look for "message". There we would find +:tl:`SendMessageRequest`, which we can work with. Every request is a Python class, and has the parameters needed for you to invoke it. You can also call ``help(request)`` for information on @@ -63,7 +63,7 @@ construct one, for instance: peer = InputPeerUser(user_id, user_hash) -Or we call ``.get_input_entity()``: +Or we call `telethon.telegram_client.TelegramClient.get_input_entity()`: .. code-block:: python @@ -74,7 +74,7 @@ When you're going to invoke an API method, most require you to pass an ``.get_input_entity()`` is more straightforward (and often immediate, if you've seen the user before, know their ID, etc.). If you also need to have information about the whole user, use -``.get_entity()`` instead: +`telethon.telegram_client.TelegramClient.get_entity()` instead: .. code-block:: python @@ -83,7 +83,7 @@ If you also need to have information about the whole user, use In the later case, when you use the entity, the library will cast it to its "input" version for you. If you already have the complete user and want to cache its input version so the library doesn't have to do this -every time its used, simply call ``.get_input_peer``: +every time its used, simply call `telethon.utils.get_input_peer`: .. code-block:: python diff --git a/readthedocs/extra/advanced-usage/sessions.rst b/readthedocs/extra/advanced-usage/sessions.rst index a2031f16..1cbd0b3a 100644 --- a/readthedocs/extra/advanced-usage/sessions.rst +++ b/readthedocs/extra/advanced-usage/sessions.rst @@ -7,7 +7,7 @@ Session Files The first parameter you pass to the constructor of the ``TelegramClient`` is the ``session``, and defaults to be the session name (or full path). That is, if you create a ``TelegramClient('anon')`` instance and connect, an -``anon.session`` file will be created on the working directory. +``anon.session`` file will be created in the working directory. Note that if you pass a string it will be a file in the current working directory, although you can also pass absolute paths. diff --git a/readthedocs/extra/advanced-usage/update-modes.rst b/readthedocs/extra/advanced-usage/update-modes.rst index 942af9c9..59f7035a 100644 --- a/readthedocs/extra/advanced-usage/update-modes.rst +++ b/readthedocs/extra/advanced-usage/update-modes.rst @@ -44,7 +44,7 @@ That's it! This is the old way to listen for raw updates, with no further processing. If this feels annoying for you, remember that you can always use :ref:`working-with-updates` but maybe use this for some other cases. -Now let's do something more interesting. Every time an user talks to use, +Now let's do something more interesting. Every time an user talks to us, let's reply to them with the same text reversed: .. code-block:: python diff --git a/readthedocs/extra/basic/installation.rst b/readthedocs/extra/basic/installation.rst index 7a240eff..c8182dbb 100644 --- a/readthedocs/extra/basic/installation.rst +++ b/readthedocs/extra/basic/installation.rst @@ -58,8 +58,7 @@ Manual Installation 5. Done! -To generate the `method documentation`__, ``cd docs`` and then -``python3 generate.py`` (if some pages render bad do it twice). +To generate the `method documentation`__, ``python3 setup.py gen docs``. Optional dependencies diff --git a/readthedocs/extra/troubleshooting/deleted-limited-or-deactivated-accounts.rst b/readthedocs/extra/troubleshooting/deleted-limited-or-deactivated-accounts.rst index 6426ada9..671306c4 100644 --- a/readthedocs/extra/troubleshooting/deleted-limited-or-deactivated-accounts.rst +++ b/readthedocs/extra/troubleshooting/deleted-limited-or-deactivated-accounts.rst @@ -2,14 +2,15 @@ Deleted, Limited or Deactivated Accounts ======================================== -If you're from Iran or Russian, we have bad news for you. -Telegram is much more likely to ban these numbers, -as they are often used to spam other accounts, -likely through the use of libraries like this one. -The best advice we can give you is to not abuse the API, -like calling many requests really quickly, +If you're from Iran or Russia, we have bad news for you. Telegram is much more +likely to ban these numbers, as they are often used to spam other accounts, +likely through the use of libraries like this one. The best advice we can +give you is to not abuse the API, like calling many requests really quickly, and to sign up with these phones through an official application. +We have also had reports from Kazakhstan and China, where connecting +would fail. To solve these connection problems, you should use a proxy. + Telegram may also ban virtual (VoIP) phone numbers, as again, they're likely to be used for spam. diff --git a/telethon/network/authenticator.py b/telethon/network/authenticator.py index 32413551..8635c030 100644 --- a/telethon/network/authenticator.py +++ b/telethon/network/authenticator.py @@ -11,8 +11,7 @@ from ..tl.types import ( ServerDHInnerData, ClientDHInnerData, DhGenOk, DhGenRetry, DhGenFail ) from .. import helpers as utils -from ..crypto import AES, AuthKey, Factorization -from ..crypto import rsa +from ..crypto import AES, AuthKey, Factorization, rsa from ..errors import SecurityError from ..extensions import BinaryReader from ..network import MtProtoPlainSender diff --git a/telethon_generator/data/html/css/docs.h4x0r.css b/telethon_generator/data/html/css/docs.h4x0r.css index 380a1243..af3cb210 100644 --- a/telethon_generator/data/html/css/docs.h4x0r.css +++ b/telethon_generator/data/html/css/docs.h4x0r.css @@ -36,10 +36,20 @@ body { font-family: 'Hack', monospace; color: #0a0; - background-color:#000; + background-color: #000; font-size: 16px; } +::-moz-selection { + color: #000; + background: #0a0; +} + +::selection { + color: #000; + background: #0a0; +} + a { color: #0a0; }