Skip to content

Commit eb64769

Browse files
committed
welcome back docs
1 parent b0c773d commit eb64769

95 files changed

Lines changed: 3785 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Development
2-
docs
32
*.session
43
config.ini
54
main.py
@@ -129,3 +128,4 @@ venv.bak/
129128
# mypy
130129
.mypy_cache/
131130
docs_build.sh
131+
.buildinfo

.readthedocs.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.12"
7+
jobs:
8+
post_install:
9+
- pip install .[docs]
10+
- cd compiler/docs && python compiler.py
11+
12+
sphinx:
13+
configuration: docs/source/conf.py
14+
15+
formats:
16+
- pdf
17+
- epub

docs/requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sphinx
2+
furo
3+
pygments
4+
sphinx_copybutton
5+
sphinx-autobuild
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. raw:: html
2+
3+
<strong>Usable by</strong>
4+
<span class="usable-by"><i class="fa-solid fa-xmark" style="color: var(--color-red)"></i> Users</span>
5+
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Bots</span>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. raw:: html
2+
3+
<strong>Usable by</strong>
4+
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Users</span>
5+
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Bots</span>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. raw:: html
2+
3+
<strong>Usable by</strong>
4+
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Users</span>
5+
<span class="usable-by"><i class="fa-solid fa-xmark" style="color: var(--color-red)"></i> Bots</span>

docs/source/api/client.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Pyrogram Client
2+
===============
3+
4+
You have entered the API Reference section where you can find detailed information about Pyrogram's API. The main Client
5+
class, all available methods and types, filters, handlers, decorators and bound-methods detailed descriptions can be
6+
found starting from this page.
7+
8+
This page is about the Client class, which exposes high-level methods for an easy access to the API.
9+
10+
.. code-block:: python
11+
12+
from pyrogram import Client
13+
14+
app = Client("my_account")
15+
16+
with app:
17+
app.send_message("me", "Hi!")
18+
19+
-----
20+
21+
Details
22+
-------
23+
24+
.. autoclass:: pyrogram.Client()

docs/source/api/decorators.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Decorators
2+
==========
3+
4+
Decorators are able to register callback functions for handling updates in a much easier and cleaner way compared to
5+
:doc:`Handlers <handlers>`; they do so by instantiating the correct handler and calling
6+
:meth:`~pyrogram.Client.add_handler` automatically. All you need to do is adding the decorators on top of your
7+
functions.
8+
9+
.. code-block:: python
10+
11+
from pyrogram import Client
12+
13+
app = Client("my_account")
14+
15+
16+
@app.on_message()
17+
def log(client, message):
18+
print(message)
19+
20+
21+
app.run()
22+
23+
24+
-----
25+
26+
.. currentmodule:: pyrogram
27+
28+
Index
29+
-----
30+
31+
.. hlist::
32+
:columns: 3
33+
34+
- :meth:`~Client.on_message`
35+
- :meth:`~Client.on_edited_message`
36+
- :meth:`~Client.on_callback_query`
37+
- :meth:`~Client.on_inline_query`
38+
- :meth:`~Client.on_chosen_inline_result`
39+
- :meth:`~Client.on_chat_member_updated`
40+
- :meth:`~Client.on_chat_join_request`
41+
- :meth:`~Client.on_deleted_messages`
42+
- :meth:`~Client.on_user_status`
43+
- :meth:`~Client.on_poll`
44+
- :meth:`~Client.on_disconnect`
45+
- :meth:`~Client.on_raw_update`
46+
47+
-----
48+
49+
Details
50+
-------
51+
52+
.. Decorators
53+
.. autodecorator:: pyrogram.Client.on_message()
54+
.. autodecorator:: pyrogram.Client.on_edited_message()
55+
.. autodecorator:: pyrogram.Client.on_callback_query()
56+
.. autodecorator:: pyrogram.Client.on_inline_query()
57+
.. autodecorator:: pyrogram.Client.on_chosen_inline_result()
58+
.. autodecorator:: pyrogram.Client.on_chat_member_updated()
59+
.. autodecorator:: pyrogram.Client.on_chat_join_request()
60+
.. autodecorator:: pyrogram.Client.on_deleted_messages()
61+
.. autodecorator:: pyrogram.Client.on_user_status()
62+
.. autodecorator:: pyrogram.Client.on_poll()
63+
.. autodecorator:: pyrogram.Client.on_disconnect()
64+
.. autodecorator:: pyrogram.Client.on_raw_update()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ChatAction
2+
==========
3+
4+
.. autoclass:: pyrogram.enums.ChatAction()
5+
:members:
6+
7+
.. raw:: html
8+
:file: ./cleanup.html
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ChatEventAction
2+
===============
3+
4+
.. autoclass:: pyrogram.enums.ChatEventAction()
5+
:members:
6+
7+
.. raw:: html
8+
:file: ./cleanup.html

0 commit comments

Comments
 (0)