diff --git a/readthedocs/conf.py b/readthedocs/conf.py index 2821e069..6c8ed0d2 100644 --- a/readthedocs/conf.py +++ b/readthedocs/conf.py @@ -20,7 +20,8 @@ import re import os import sys -sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath(os.curdir)) +sys.path.insert(0, os.path.abspath(os.pardir)) root = os.path.abspath(os.path.join(__file__, os.path.pardir, os.path.pardir)) diff --git a/readthedocs/extra/advanced-usage/accessing-the-full-api.rst b/readthedocs/extra/advanced-usage/accessing-the-full-api.rst index 31efa51c..c27d9a02 100644 --- a/readthedocs/extra/advanced-usage/accessing-the-full-api.rst +++ b/readthedocs/extra/advanced-usage/accessing-the-full-api.rst @@ -7,7 +7,7 @@ Accessing the Full API .. important:: While you have access to this, you should always use the friendly - methods listed on :ref:`telethon-package` unless you have a better + methods listed on :ref:`telethon-client` unless you have a better reason not to, like a method not existing or you wanting more control. diff --git a/readthedocs/extra/basic/getting-started.rst b/readthedocs/extra/basic/getting-started.rst index 5ded472e..21830c21 100644 --- a/readthedocs/extra/basic/getting-started.rst +++ b/readthedocs/extra/basic/getting-started.rst @@ -65,7 +65,7 @@ Basic Usage **More details**: :ref:`telegram-client` - See :ref:`telethon-package` for all available friendly methods. + See :ref:`telethon-client` for all available friendly methods. Handling Updates diff --git a/readthedocs/extra/basic/telegram-client.rst b/readthedocs/extra/basic/telegram-client.rst index 5116e32b..273637ed 100644 --- a/readthedocs/extra/basic/telegram-client.rst +++ b/readthedocs/extra/basic/telegram-client.rst @@ -10,9 +10,9 @@ Introduction .. note:: - Make sure to use the friendly methods described in :ref:`telethon-package`! + Make sure to use the friendly methods described in :ref:`telethon-client`! This section is just an introduction to using the client, but all the - available methods are in the :ref:`telethon-package` reference, including + available methods are in the :ref:`telethon-client` reference, including detailed descriptions to what they do. The ``TelegramClient`` is the central class of the library, the one @@ -99,7 +99,7 @@ Please refer to :ref:`accessing-the-full-api` if these aren't enough, and don't be afraid to read the source code of the InteractiveTelegramClient_ or even the TelegramClient_ itself to learn how it works. -See the mentioned :ref:`telethon-package` to find the available methods. +See the mentioned :ref:`telethon-client` to find the available methods. .. _InteractiveTelegramClient: https://github.com/LonamiWebs/Telethon/blob/master/telethon_examples/interactive_telegram_client.py .. _TelegramClient: https://github.com/LonamiWebs/Telethon/blob/master/telethon/telegram_client.py diff --git a/readthedocs/index.rst b/readthedocs/index.rst index f95c4bbb..994ea2e5 100644 --- a/readthedocs/index.rst +++ b/readthedocs/index.rst @@ -16,9 +16,9 @@ when you upgrade! .. important:: If you're new here, you want to read :ref:`getting-started`. If you're - looking for the method reference, you should check :ref:`telethon-package`. + looking for the method reference, you should check :ref:`telethon-client`. - The mentioned :ref:`telethon-package` is an important section and it + The mentioned :ref:`telethon-client` is an important section and it contains the friendly methods that **you should use** most of the time. diff --git a/readthedocs/telethon.client.rst b/readthedocs/telethon.client.rst new file mode 100644 index 00000000..fa9518aa --- /dev/null +++ b/readthedocs/telethon.client.rst @@ -0,0 +1,76 @@ +.. _telethon-client: + + +telethon\.client package +======================== + +The `telethon.TelegramClient` aggregates several mixin classes to provide +all the common functionality in a nice, Pythonic interface. Each mixin has +its own methods, which you all can use. + +**In short, to create a client you must run:** + +.. code-block:: python + + import asyncio + from telethon import TelegramClient + + async def main(): + client = await TelegramClient(name, api_id, api_hash).start() + # Now you can use all client methods listed below, like for example... + await client.send_message('me', 'Hello to myself!') + + asyncio.get_event_loop().run_until_complete() + + +You **don't** need to import these `AuthMethods`, `MessageMethods`, etc. +Together they are the `telethon.TelegramClient` and you can access all of +their methods. + + +.. automodule:: telethon.client.auth + :members: + :undoc-members: + :show-inheritance: + + +.. automodule:: telethon.client.chats + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: telethon.client.dialogs + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: telethon.client.messageparse + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: telethon.client.messages + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: telethon.client.updates + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: telethon.client.uploads + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: telethon.client.users + :members: + :undoc-members: + :show-inheritance: + + +.. automodule:: telethon.client.telegrambaseclient + :members: + :undoc-members: + :show-inheritance: diff --git a/readthedocs/telethon.crypto.rst b/readthedocs/telethon.crypto.rst deleted file mode 100644 index 8adf55d5..00000000 --- a/readthedocs/telethon.crypto.rst +++ /dev/null @@ -1,53 +0,0 @@ -telethon\.crypto package -======================== - - -telethon\.crypto\.aes module ----------------------------- - -.. automodule:: telethon.crypto.aes - :members: - :undoc-members: - :show-inheritance: - -telethon\.crypto\.aes\_ctr module ---------------------------------- - -.. automodule:: telethon.crypto.aes_ctr - :members: - :undoc-members: - :show-inheritance: - -telethon\.crypto\.auth\_key module ----------------------------------- - -.. automodule:: telethon.crypto.auth_key - :members: - :undoc-members: - :show-inheritance: - -telethon\.crypto\.cdn\_decrypter module ---------------------------------------- - -.. automodule:: telethon.crypto.cdn_decrypter - :members: - :undoc-members: - :show-inheritance: - -telethon\.crypto\.factorization module --------------------------------------- - -.. automodule:: telethon.crypto.factorization - :members: - :undoc-members: - :show-inheritance: - -telethon\.crypto\.rsa module ----------------------------- - -.. automodule:: telethon.crypto.rsa - :members: - :undoc-members: - :show-inheritance: - - diff --git a/readthedocs/telethon.errors.rst b/readthedocs/telethon.errors.rst index e90d1819..f69e2967 100644 --- a/readthedocs/telethon.errors.rst +++ b/readthedocs/telethon.errors.rst @@ -13,12 +13,10 @@ telethon\.errors\.common module :undoc-members: :show-inheritance: -telethon\.errors\.rpc\_base\_errors module ------------------------------------------- +telethon\.errors\.rpcbaseerrors module +-------------------------------------- -.. automodule:: telethon.errors.rpc_base_errors +.. automodule:: telethon.errors.rpcbaseerrors :members: :undoc-members: :show-inheritance: - - diff --git a/readthedocs/telethon.events.rst b/readthedocs/telethon.events.rst index 5aaa0ba6..0d18415a 100644 --- a/readthedocs/telethon.events.rst +++ b/readthedocs/telethon.events.rst @@ -58,4 +58,3 @@ so all the methods in it can be used from any event builder/event instance. :members: :undoc-members: :show-inheritance: - diff --git a/readthedocs/telethon.extensions.rst b/readthedocs/telethon.extensions.rst index 578728b5..2b834277 100644 --- a/readthedocs/telethon.extensions.rst +++ b/readthedocs/telethon.extensions.rst @@ -2,10 +2,10 @@ telethon\.extensions package ============================ -telethon\.extensions\.binary\_reader module -------------------------------------------- +telethon\.extensions\.binaryreader module +----------------------------------------- -.. automodule:: telethon.extensions.binary_reader +.. automodule:: telethon.extensions.binaryreader :members: :undoc-members: :show-inheritance: @@ -18,12 +18,18 @@ telethon\.extensions\.markdown module :undoc-members: :show-inheritance: -telethon\.extensions\.tcp\_client module ----------------------------------------- +telethon\.extensions\.html module +--------------------------------- -.. automodule:: telethon.extensions.tcp_client +.. automodule:: telethon.extensions.html :members: :undoc-members: :show-inheritance: +telethon\.extensions\.tcpclient module +-------------------------------------- +.. automodule:: telethon.extensions.tcpclient + :members: + :undoc-members: + :show-inheritance: diff --git a/readthedocs/telethon.network.rst b/readthedocs/telethon.network.rst index 3600e985..79da891b 100644 --- a/readthedocs/telethon.network.rst +++ b/readthedocs/telethon.network.rst @@ -2,14 +2,6 @@ telethon\.network package ========================= -telethon\.network\.authenticator module ---------------------------------------- - -.. automodule:: telethon.network.authenticator - :members: - :undoc-members: - :show-inheritance: - telethon\.network\.connection module ------------------------------------ @@ -18,20 +10,26 @@ telethon\.network\.connection module :undoc-members: :show-inheritance: -telethon\.network\.mtproto\_plain\_sender module +telethon\.network\.mtprotoplainsender module ------------------------------------------------ -.. automodule:: telethon.network.mtproto_plain_sender +.. automodule:: telethon.network.mtprotoplainsender :members: :undoc-members: :show-inheritance: -telethon\.network\.mtproto\_sender module +telethon\.network\.mtprotosender module ----------------------------------------- -.. automodule:: telethon.network.mtproto_sender +.. automodule:: telethon.network.mtprotosender :members: :undoc-members: :show-inheritance: +telethon\.network\.authenticator module +--------------------------------------- +.. automodule:: telethon.network.authenticator + :members: + :undoc-members: + :show-inheritance: diff --git a/readthedocs/telethon.rst b/readthedocs/telethon.rst index 0b60b007..dadf0810 100644 --- a/readthedocs/telethon.rst +++ b/readthedocs/telethon.rst @@ -5,21 +5,18 @@ telethon package ================ -telethon\.telegram\_client module ---------------------------------- +telethon\.client module +----------------------- -.. automodule:: telethon.telegram_client +.. toctree:: + + telethon.client + +.. automodule:: telethon.client :members: :undoc-members: :show-inheritance: -telethon\.telegram\_bare\_client module ---------------------------------------- - -.. automodule:: telethon.telegram_bare_client - :members: - :undoc-members: - :show-inheritance: telethon\.utils module ---------------------- @@ -29,13 +26,6 @@ telethon\.utils module :undoc-members: :show-inheritance: -telethon\.helpers module ------------------------- - -.. automodule:: telethon.helpers - :members: - :undoc-members: - :show-inheritance: telethon\.events package ------------------------ @@ -45,14 +35,6 @@ telethon\.events package telethon.events -telethon\.update\_state module ------------------------------- - -.. automodule:: telethon.update_state - :members: - :undoc-members: - :show-inheritance: - telethon\.sessions module ------------------------- @@ -61,13 +43,6 @@ telethon\.sessions module :undoc-members: :show-inheritance: -telethon\.cryto package ------------------------- - -.. toctree:: - - telethon.crypto - telethon\.errors package ------------------------ @@ -97,7 +72,6 @@ telethon\.tl package telethon.tl - Module contents --------------- diff --git a/readthedocs/telethon.tl.rst b/readthedocs/telethon.tl.rst index a10ecc68..7e8c1da1 100644 --- a/readthedocs/telethon.tl.rst +++ b/readthedocs/telethon.tl.rst @@ -1,5 +1,5 @@ -telethon\.tl package -==================== +telethon\.tl\.custom package +============================ .. toctree:: @@ -7,30 +7,6 @@ telethon\.tl package telethon.tl.custom -telethon\.tl\.gzip\_packed module ---------------------------------- - -.. automodule:: telethon.tl.gzip_packed - :members: - :undoc-members: - :show-inheritance: - -telethon\.tl\.message\_container module ---------------------------------------- - -.. automodule:: telethon.tl.message_container - :members: - :undoc-members: - :show-inheritance: - -telethon\.tl\.tl\_message module --------------------------------- - -.. automodule:: telethon.tl.tl_message - :members: - :undoc-members: - :show-inheritance: - telethon\.tl\.tlobject module ----------------------------- @@ -38,4 +14,3 @@ telethon\.tl\.tlobject module :members: :undoc-members: :show-inheritance: -