diff --git a/docs/source/_static/css/theme.css b/docs/source/_static/css/theme.css index 86ae2a38..af6f4489 100644 --- a/docs/source/_static/css/theme.css +++ b/docs/source/_static/css/theme.css @@ -3590,7 +3590,7 @@ code,.rst-content tt,.rst-content code{ max-width:100%; background:#fff; border:solid 1px #e1e4e5; - font-size:85%; + font-size:80%; padding:0 5px; font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace; color:#E74C3C; @@ -4518,11 +4518,11 @@ footer span.commit code,footer span.commit .rst-content tt,.rst-content footer s line-height:normal } .rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal{ - color:#E74C3C + color:#404040 } .rst-content tt.xref,a .rst-content tt,.rst-content tt.xref,.rst-content code.xref,a .rst-content tt,a .rst-content code{ font-weight:bold; - color:#404040 + color:#2980B9 } .rst-content a tt,.rst-content a tt,.rst-content a code{ color:#2980B9 diff --git a/docs/source/pyrogram/Emoji.rst b/docs/source/pyrogram/Emoji.rst index 6f0d7fda..13476604 100644 --- a/docs/source/pyrogram/Emoji.rst +++ b/docs/source/pyrogram/Emoji.rst @@ -1,6 +1,2 @@ Emoji ====== - -.. autoclass:: pyrogram.Emoji - :members: - :undoc-members: diff --git a/docs/source/pyrogram/index.rst b/docs/source/pyrogram/index.rst index 7f64648d..d8ff3487 100644 --- a/docs/source/pyrogram/index.rst +++ b/docs/source/pyrogram/index.rst @@ -3,7 +3,7 @@ Pyrogram In this section you can find a detailed description of the Pyrogram API. -:obj:`pyrogram.Client` is the main class you have to deal with. +:class:`Client ` is the main class you have to deal with. You will notice that methods are named after the well established `Telegram Bot API`_ and that most of them accept the same parameters as well, thus offering a familiar look to Bot developers. diff --git a/docs/source/resources/AutoAuthorization.rst b/docs/source/resources/AutoAuthorization.rst index 1aff63c5..1e2d72f0 100644 --- a/docs/source/resources/AutoAuthorization.rst +++ b/docs/source/resources/AutoAuthorization.rst @@ -3,17 +3,17 @@ Auto Authorization Manually writing phone number, phone code and password on the terminal every time you want to login can be tedious. Pyrogram is able to automate both **Log In** and **Sign Up** processes, all you need to do is pass the relevant -parameters when creating a new Client. +parameters when creating a new :class:`Client `. .. note:: If you omit any of the optional parameter required for the authorization, Pyrogram will ask you to - manually write it. For instance, if you don't want to set a *last_name* when creating a new account you + manually write it. For instance, if you don't want to set a ``last_name`` when creating a new account you have to explicitly pass an empty string ""; the default value (None) will trigger the input() call. Log In ------- -To automate the **Log In** process, pass your *phone_number* and *password* (if you have one) in the Client parameters. -If you want to retrieve the phone code programmatically, pass a callback function in the *phone_code* field — this +To automate the **Log In** process, pass your ``phone_number`` and ``password`` (if you have one) in the Client parameters. +If you want to retrieve the phone code programmatically, pass a callback function in the ``phone_code`` field — this function must return the correct phone code as string (e.g., "12345") — otherwise, ignore this parameter, Pyrogram will ask you to input the phone code manually. @@ -40,7 +40,7 @@ Sign Up ------- To automate the **Sign Up** process (i.e., automatically create a new Telegram account), simply fill **both** -*first_name* and *last_name* fields alongside the other parameters; they will be used to automatically create a new +``first_name`` and ``last_name`` fields alongside the other parameters; they will be used to automatically create a new Telegram account in case the phone number you passed is not registered yet. .. code-block:: python diff --git a/docs/source/resources/SOCKS5Proxy.rst b/docs/source/resources/SOCKS5Proxy.rst index 02822eeb..f51448ec 100644 --- a/docs/source/resources/SOCKS5Proxy.rst +++ b/docs/source/resources/SOCKS5Proxy.rst @@ -25,7 +25,7 @@ Usage - ``1``, ``yes``, ``True`` or ``on``: Enables the proxy - ``0``, ``no``, ``False`` or ``off``: Disables the proxy -- Alternatively, you can setup your proxy without the need of the *config.ini* file by using the *proxy* parameter +- Alternatively, you can setup your proxy without the need of the ``config.ini`` file by using the *proxy* parameter in the Client class: .. code-block:: python @@ -46,5 +46,5 @@ Usage ... -.. note:: If your proxy doesn't require authorization you can omit *username* and *password* by either leaving the +.. note:: If your proxy doesn't require authorization you can omit ``username`` and ``password`` by either leaving the values blank/empty or completely delete the lines. \ No newline at end of file diff --git a/docs/source/resources/TextFormatting.rst b/docs/source/resources/TextFormatting.rst index 976bd8c6..ffec21b9 100644 --- a/docs/source/resources/TextFormatting.rst +++ b/docs/source/resources/TextFormatting.rst @@ -8,7 +8,7 @@ Beside bold, italic, and pre-formatted code, **Pyrogram does also support inline Markdown Style -------------- -To use this mode, pass :obj:`pyrogram.ParseMode.MARKDOWN` or "markdown" in the *parse_mode* field when using +To use this mode, pass :obj:`MARKDOWN ` or "markdown" in the *parse_mode* field when using :obj:`send_message `. Use the following syntax in your message: .. code:: @@ -30,7 +30,7 @@ To use this mode, pass :obj:`pyrogram.ParseMode.MARKDOWN` or "markdown" in the * HTML Style ---------- -To use this mode, pass :obj:`pyrogram.ParseMode.HTML` or "html" in the *parse_mode* field when using +To use this mode, pass :obj:`HTML ` or "html" in the *parse_mode* field when using :obj:`send_message `. The following tags are currently supported: .. code:: diff --git a/docs/source/resources/UpdateHandling.rst b/docs/source/resources/UpdateHandling.rst index 4293054f..c13202c3 100644 --- a/docs/source/resources/UpdateHandling.rst +++ b/docs/source/resources/UpdateHandling.rst @@ -2,10 +2,10 @@ Update Handling =============== Updates are events that happen in your Telegram account (incoming messages, new channel posts, user name changes, ...) -and can be handled by using a callback function, that is, a function called every time an :obj:`Update` is received from +and can be handled by using a callback function, that is, a function called every time an ``Update`` is received from Telegram. -To set an update handler simply call :obj:`set_update_handler ` +To set an update handler simply call :meth:`set_update_handler ` by passing the name of your defined callback function as argument *before* you start the Client. Here's a complete example on how to set it up: @@ -28,9 +28,9 @@ Here's a complete example on how to set it up: if __name__ == "__main__": main() -The last line of the main() function, :obj:`client.idle() `, is not strictly necessary but highly -recommended when using the update handler; it will block your script execution until you press :obj:`CTRL`:obj:`C` and -automatically call the :obj:`stop ` method which stops the Client and gently close the underlying +The last line of the main function, :meth:`client.idle() `, is not strictly necessary but highly +recommended when using the update handler; it will block your script execution until you press ``CTRL+C`` and +automatically call the :meth:`stop ` method which stops the Client and gently close the underlying connection. Examples diff --git a/docs/source/start/BasicUsage.rst b/docs/source/start/BasicUsage.rst index 50b21375..3e04dee0 100644 --- a/docs/source/start/BasicUsage.rst +++ b/docs/source/start/BasicUsage.rst @@ -3,14 +3,14 @@ Basic Usage .. note:: - All the snippets below assume you have successfully created and started a :obj:`pyrogram.Client` instance. - You also must be authorized, that is, a valid *.session file does exist in your working directory. + All the snippets below assume you have successfully created and started a :class:`Client ` + instance. You also must be authorized, that is, a valid *.session file does exist in your working directory. Simple API Access ----------------- -The easiest way to interact with the API is via the :obj:`pyrogram.Client` class which exposes bot-like_ methods. -The purpose of this Client class is to make it even simpler to work with Telegram's API by abstracting the +The easiest way to interact with the API is via the :class:`Client ` class which exposes bot-like_ +methods. The purpose of this Client class is to make it even simpler to work with Telegram's API by abstracting the raw functions listed in the API scheme. The result is a much cleaner interface that allows you to: @@ -30,7 +30,7 @@ The result is a much cleaner interface that allows you to: text="Hi there! I'm using Pyrogram" ) -.. seealso:: For a complete list of the available methods have a look at the :obj:`pyrogram.Client` class. +.. seealso:: For a complete list of the available methods have a look at the :class:`Client ` class. .. _using-raw-functions: @@ -38,8 +38,8 @@ Using Raw Functions ------------------- If you want **complete**, low-level access to the Telegram API you have to use the raw -:obj:`functions ` and :obj:`types ` exposed by the ``pyrogram.api`` -package and call any Telegram API method you wish using the :obj:`send ` method provided by +:mod:`functions ` and :mod:`types ` exposed by the ``pyrogram.api`` +package and call any Telegram API method you wish using the :meth:`send ` method provided by the Client class. Here some examples: diff --git a/docs/source/start/ProjectSetup.rst b/docs/source/start/ProjectSetup.rst index 3d0dea32..323e6a0c 100644 --- a/docs/source/start/ProjectSetup.rst +++ b/docs/source/start/ProjectSetup.rst @@ -44,15 +44,15 @@ There are two ways to configure a Pyrogram application project, and you can choo ) .. note:: The examples below will assume you have created a *config.ini* file, thus they won't show the *api_key* - parameter usage in the Client class. + parameter usage in the :class:`Client ` class. Authorization ------------- Telegram requires that users be authorized in order to use the API. Pyrogram automatically manages this access, all you need to do is create an instance of -the :class:`pyrogram.Client` class by passing to it a ```` of your choice -and call the :obj:`start ` method: +the :class:`Client ` class by passing to it a ```` of your choice +and call the :meth:`start ` method: .. code-block:: python