mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-31 22:35:36 +00:00
Update docs
This commit is contained in:
@@ -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 <pyrogram.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 <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
|
||||
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 <pyrogram.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 <pyrogram.api.functions>` and :obj:`types <pyrogram.api.types>` exposed by the ``pyrogram.api``
|
||||
package and call any Telegram API method you wish using the :obj:`send <pyrogram.Client.send>` method provided by
|
||||
:mod:`functions <pyrogram.api.functions>` and :mod:`types <pyrogram.api.types>` exposed by the ``pyrogram.api``
|
||||
package and call any Telegram API method you wish using the :meth:`send <pyrogram.Client.send>` method provided by
|
||||
the Client class.
|
||||
|
||||
Here some examples:
|
||||
|
@@ -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 <pyrogram.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 ``<session_name>`` of your choice
|
||||
and call the :obj:`start <pyrogram.Client.start>` method:
|
||||
the :class:`Client <pyrogram.Client>` class by passing to it a ``<session_name>`` of your choice
|
||||
and call the :meth:`start <pyrogram.Client.start>` method:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
Reference in New Issue
Block a user