Update docs with new content · Python-Repository-Hub/pyrogram@1be8ca9 · GitHub
Skip to content

Commit 1be8ca9

Browse files
committed
Update docs with new content
1 parent 9a44c79 commit 1be8ca9

8 files changed

Lines changed: 295 additions & 131 deletions

File tree

docs/source/faq.rst

Lines changed: 22 additions & 2 deletions

docs/source/glossary.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ general. Some words may as well link to dedicated articles in case the topic is
99
If you think something interesting could be added here, feel free to propose it by opening a `Feature Request`_.
1010

1111

12+
Terms
13+
-----
14+
1215
.. glossary::
16+
:sorted:
1317

1418
API
1519
Application Programming Interface: a set of methods, protocols and tools that make it easier to develop programs

docs/source/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ Meta
122122
:hidden:
123123
:caption: Topic Guides
124124

125-
topics/filters
125+
topics/use-filters
126+
topics/create-filters
126127
topics/more-on-updates
127128
topics/config-file
128129
topics/smart-plugins
@@ -134,6 +135,7 @@ Meta
134135
topics/proxy
135136
topics/bots-interaction
136137
topics/mtproto-vs-botapi
138+
topics/debugging
137139
topics/test-servers
138140
topics/advanced-usage
139141
topics/voice-calls

docs/source/start/invoking.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,40 @@ Making API method calls with Pyrogram is very simple. Here's an example we are g
2424
2525
app.stop()
2626
27-
Let's begin by importing the Client class from the Pyrogram package:
27+
#. Let's begin by importing the Client class from the Pyrogram package:
2828

29-
.. code-block:: python
29+
.. code-block:: python
3030
31-
from pyrogram import Client
31+
from pyrogram import Client
3232
33-
Now instantiate a new Client object, "my_account" is a session name of your choice:
33+
#. Now instantiate a new Client object, "my_account" is a session name of your choice:
3434

35-
.. code-block:: python
35+
.. code-block:: python
3636
37-
app = Client("my_account")
37+
app = Client("my_account")
3838
39-
To actually make use of any method, the client has to be started first:
39+
#. To actually make use of any method, the client has to be started first:
4040

41-
.. code-block:: python
41+
.. code-block:: python
4242
43-
app.start()
43+
app.start()
4444
45-
Now, you can call any method you like:
45+
#. Now, you can call any method you like:
4646

47-
.. code-block:: python
47+
.. code-block:: python
4848
49-
print(app.get_me()) # Print information about yourself
49+
print(app.get_me()) # Print information about yourself
5050
51-
# Send messages to yourself:
52-
app.send_message("me", "Hi!") # Text message
53-
app.send_location("me", 51.500729, -0.124583) # Location
54-
app.send_sticker("me", "CAADBAADyg4AAvLQYAEYD4F7vcZ43AI") # Sticker
51+
# Send messages to yourself:
52+
app.send_message("me", "Hi!") # Text message
53+
app.send_location("me", 51.500729, -0.124583) # Location
54+
app.send_sticker("me", "CAADBAADyg4AAvLQYAEYD4F7vcZ43AI") # Sticker
5555
56-
Finally, when done, simply stop the client:
56+
#. Finally, when done, simply stop the client:
5757

58-
.. code-block:: python
58+
.. code-block:: python
5959
60-
app.stop()
60+
app.stop()
6161
6262
Context Manager
6363
---------------

docs/source/start/updates.rst

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,37 @@ arrives:
4545
4646
app.run()
4747
48-
Let's examine these four new pieces. First one: a callback function we defined which accepts two arguments -
49-
*(client, message)*. This will be the function that gets executed every time a new message arrives and Pyrogram will
50-
call that function by passing the client instance and the new message instance as argument.
48+
#. Let's examine these four new pieces. First one: a callback function we defined which accepts two arguments -
49+
*(client, message)*. This will be the function that gets executed every time a new message arrives and Pyrogram will
50+
call that function by passing the client instance and the new message instance as argument.
5151

52-
.. code-block:: python
52+
.. code-block:: python
5353
54-
def my_function(client, message):
55-
print(message)
54+
def my_function(client, message):
55+
print(message)
5656
57-
Second one: the :class:`~pyrogram.MessageHandler`. This object tells Pyrogram the function we defined above must only
58-
handle updates that are in form of a :class:`~pyrogram.Message`:
57+
#. Second one: the :class:`~pyrogram.MessageHandler`. This object tells Pyrogram the function we defined above must
58+
only handle updates that are in form of a :class:`~pyrogram.Message`:
5959

60-
.. code-block:: python
60+
.. code-block:: python
6161
62-
my_handler = MessageHandler(my_function)
62+
my_handler = MessageHandler(my_function)
6363
64-
Third: the method :meth:`~pyrogram.Client.add_handler`. This method is used to actually register the handler and let
65-
Pyrogram know it needs to be taken into consideration when new updates arrive and the internal dispatching phase begins.
64+
#. Third: the method :meth:`~pyrogram.Client.add_handler`. This method is used to actually register the handler and let
65+
Pyrogram know it needs to be taken into consideration when new updates arrive and the internal dispatching phase
66+
begins.
6667

67-
.. code-block:: python
68+
.. code-block:: python
6869
69-
app.add_handler(my_handler)
70+
app.add_handler(my_handler)
7071
71-
Last one, the :meth:`~pyrogram.Client.run` method. What this does is simply call :meth:`~pyrogram.Client.start` and a
72-
special method :meth:`~pyrogram.Client.idle` that keeps your main scripts alive until you press ``CTRL+C``; the client
73-
will be automatically stopped after that.
72+
#. Last one, the :meth:`~pyrogram.Client.run` method. What this does is simply call :meth:`~pyrogram.Client.start` and
73+
a special method :meth:`~pyrogram.Client.idle` that keeps your main scripts alive until you press ``CTRL+C``; the
74+
client will be automatically stopped after that.
7475

75-
.. code-block:: python
76+
.. code-block:: python
7677
77-
app.run()
78+
app.run()
7879
7980
Using Decorators
8081
----------------
Lines changed: 92 additions & 0 deletions

0 commit comments

Comments
 (0)