2018-01-15 11:36:03 +00:00
|
|
|
Welcome to Pyrogram
|
|
|
|
===================
|
|
|
|
|
2017-12-30 18:47:18 +00:00
|
|
|
.. raw:: html
|
|
|
|
|
2017-12-31 10:03:10 +00:00
|
|
|
<div align="center">
|
2019-05-23 16:59:29 +00:00
|
|
|
<a href="/">
|
2022-01-07 09:18:51 +00:00
|
|
|
<div class="pyrogram-logo-index"><img src="_static/pyrogram.png" alt="Pyrogram"></div>
|
|
|
|
<div class="pyrogram-text pyrogram-text-index">Pyrogram</div>
|
2018-01-01 12:55:05 +00:00
|
|
|
</a>
|
2017-12-31 10:03:10 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<p align="center">
|
2019-01-24 19:03:14 +00:00
|
|
|
<b>Telegram MTProto API Framework for Python</b>
|
|
|
|
|
2018-01-13 16:09:25 +00:00
|
|
|
<br>
|
2022-04-24 09:56:07 +00:00
|
|
|
<a href="https://pyrogram.org">
|
2022-04-24 09:56:07 +00:00
|
|
|
Homepage
|
2018-01-13 16:09:25 +00:00
|
|
|
</a>
|
|
|
|
•
|
2022-04-24 09:56:07 +00:00
|
|
|
<a href="https://github.com/pyrogram/pyrogram">
|
|
|
|
Development
|
|
|
|
</a>
|
|
|
|
•
|
2022-01-07 09:18:51 +00:00
|
|
|
<a href="https://docs.pyrogram.org/releases">
|
2019-05-13 16:04:44 +00:00
|
|
|
Releases
|
2018-01-13 16:09:25 +00:00
|
|
|
</a>
|
|
|
|
•
|
2022-01-07 09:18:51 +00:00
|
|
|
<a href="https://t.me/pyrogram">
|
|
|
|
News
|
2018-01-10 19:56:43 +00:00
|
|
|
</a>
|
2017-12-31 10:03:10 +00:00
|
|
|
</p>
|
2017-12-30 18:47:18 +00:00
|
|
|
|
2018-04-12 12:13:58 +00:00
|
|
|
.. code-block:: python
|
|
|
|
|
2020-08-22 06:05:05 +00:00
|
|
|
from pyrogram import Client, filters
|
2018-04-12 12:13:58 +00:00
|
|
|
|
|
|
|
app = Client("my_account")
|
|
|
|
|
|
|
|
|
2020-08-22 06:05:05 +00:00
|
|
|
@app.on_message(filters.private)
|
|
|
|
async def hello(client, message):
|
2022-01-07 09:18:51 +00:00
|
|
|
await message.reply("Hello from Pyrogram!")
|
2018-04-12 12:13:58 +00:00
|
|
|
|
|
|
|
|
2018-06-22 11:17:39 +00:00
|
|
|
app.run()
|
2018-04-12 12:13:58 +00:00
|
|
|
|
2022-01-07 09:18:51 +00:00
|
|
|
**Pyrogram** is a modern, elegant and asynchronous :doc:`MTProto API <topics/mtproto-vs-botapi>` framework.
|
|
|
|
It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot identity
|
|
|
|
(bot API alternative) using Python.
|
2018-01-06 11:18:15 +00:00
|
|
|
|
2022-01-07 09:18:51 +00:00
|
|
|
Support
|
|
|
|
-------
|
|
|
|
|
|
|
|
If you'd like to support Pyrogram, you can consider:
|
|
|
|
|
|
|
|
- `Become a GitHub sponsor <https://github.com/sponsors/delivrance>`_.
|
|
|
|
- `Become a LiberaPay patron <https://liberapay.com/delivrance>`_.
|
|
|
|
- `Become an OpenCollective backer <https://opencollective.com/pyrogram>`_.
|
|
|
|
|
2019-05-12 17:26:55 +00:00
|
|
|
How the Documentation is Organized
|
2019-05-10 14:14:10 +00:00
|
|
|
----------------------------------
|
|
|
|
|
2020-08-22 06:05:05 +00:00
|
|
|
Contents are organized into sections composed of self-contained topics which can be all accessed from the sidebar, or by
|
2022-04-24 09:56:07 +00:00
|
|
|
following them in order using the :guilabel:`Next` button at the end of each page.
|
|
|
|
You can also switch to Dark or Light theme or leave on Auto (follows system preferences) by using the dedicated button
|
|
|
|
in the top left corner.
|
|
|
|
|
|
|
|
Here below you can, instead, find a list of the most relevant pages for a quick access.
|
2019-05-12 17:26:55 +00:00
|
|
|
|
2019-05-17 23:45:01 +00:00
|
|
|
First Steps
|
2019-06-22 23:32:04 +00:00
|
|
|
^^^^^^^^^^^
|
2019-05-12 17:26:55 +00:00
|
|
|
|
2019-05-23 16:59:29 +00:00
|
|
|
.. hlist::
|
2022-01-07 09:18:51 +00:00
|
|
|
:columns: 1
|
2019-05-23 16:59:29 +00:00
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
- :doc:`Quick Start <intro/quickstart>`: Overview to get you started quickly.
|
2022-04-24 09:56:07 +00:00
|
|
|
- :doc:`Invoking Methods <start/invoking>`: How to call Pyrogram's methods.
|
2019-05-28 14:41:55 +00:00
|
|
|
- :doc:`Handling Updates <start/updates>`: How to handle Telegram updates.
|
|
|
|
- :doc:`Error Handling <start/errors>`: How to handle API errors correctly.
|
2019-05-12 17:26:55 +00:00
|
|
|
|
|
|
|
API Reference
|
2019-06-22 23:32:04 +00:00
|
|
|
^^^^^^^^^^^^^
|
2019-05-23 16:59:29 +00:00
|
|
|
|
|
|
|
.. hlist::
|
2022-01-07 09:18:51 +00:00
|
|
|
:columns: 1
|
2019-05-17 23:45:01 +00:00
|
|
|
|
2019-05-28 14:41:55 +00:00
|
|
|
- :doc:`Pyrogram Client <api/client>`: Reference details about the Client class.
|
2019-07-09 18:02:51 +00:00
|
|
|
- :doc:`Available Methods <api/methods/index>`: List of available high-level methods.
|
|
|
|
- :doc:`Available Types <api/types/index>`: List of available high-level types.
|
2022-04-24 09:56:06 +00:00
|
|
|
- :doc:`Enumerations <api/enums/index>`: List of available enumerations.
|
2019-07-09 18:02:51 +00:00
|
|
|
- :doc:`Bound Methods <api/bound-methods/index>`: List of convenient bound methods.
|
2018-01-06 11:18:15 +00:00
|
|
|
|
2019-05-19 19:40:41 +00:00
|
|
|
Meta
|
2019-06-22 23:32:04 +00:00
|
|
|
^^^^
|
2019-05-23 16:59:29 +00:00
|
|
|
|
|
|
|
.. hlist::
|
2022-01-07 09:18:51 +00:00
|
|
|
:columns: 1
|
2018-01-06 11:18:15 +00:00
|
|
|
|
2022-01-07 09:18:51 +00:00
|
|
|
- :doc:`Pyrogram FAQ <faq/index>`: Answers to common Pyrogram questions.
|
2021-03-06 10:33:07 +00:00
|
|
|
- :doc:`Support Pyrogram <support>`: Ways to show your appreciation.
|
2019-06-05 09:05:01 +00:00
|
|
|
- :doc:`Release Notes <releases/index>`: Release notes for Pyrogram releases.
|
2018-03-26 01:58:10 +00:00
|
|
|
|
2020-08-22 06:05:05 +00:00
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:caption: Introduction
|
|
|
|
|
|
|
|
intro/quickstart
|
|
|
|
intro/install
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:caption: Getting Started
|
|
|
|
|
2022-04-24 09:56:07 +00:00
|
|
|
start/setup
|
2020-08-22 06:05:05 +00:00
|
|
|
start/auth
|
|
|
|
start/invoking
|
|
|
|
start/updates
|
|
|
|
start/errors
|
|
|
|
start/examples/index
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:caption: API Reference
|
|
|
|
|
|
|
|
api/client
|
|
|
|
api/methods/index
|
|
|
|
api/types/index
|
|
|
|
api/bound-methods/index
|
2022-04-24 09:56:06 +00:00
|
|
|
api/enums/index
|
2020-08-22 06:05:05 +00:00
|
|
|
api/handlers
|
|
|
|
api/decorators
|
|
|
|
api/errors/index
|
|
|
|
api/filters
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:caption: Topic Guides
|
|
|
|
|
|
|
|
topics/use-filters
|
|
|
|
topics/create-filters
|
|
|
|
topics/more-on-updates
|
2022-01-07 09:18:51 +00:00
|
|
|
topics/client-settings
|
2022-04-24 09:56:07 +00:00
|
|
|
topics/speedups
|
2022-04-24 09:56:07 +00:00
|
|
|
topics/text-formatting
|
|
|
|
topics/synchronous
|
2022-04-24 09:56:07 +00:00
|
|
|
topics/smart-plugins
|
2020-08-22 06:05:05 +00:00
|
|
|
topics/storage-engines
|
|
|
|
topics/serializing
|
|
|
|
topics/proxy
|
|
|
|
topics/scheduling
|
|
|
|
topics/mtproto-vs-botapi
|
|
|
|
topics/debugging
|
|
|
|
topics/test-servers
|
|
|
|
topics/advanced-usage
|
|
|
|
topics/voice-calls
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:caption: Meta
|
|
|
|
|
2022-01-07 09:18:51 +00:00
|
|
|
faq/index
|
2021-03-06 10:33:07 +00:00
|
|
|
support
|
2020-08-22 06:05:05 +00:00
|
|
|
releases/index
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
2022-04-24 09:56:07 +00:00
|
|
|
:caption: Telegram Raw API
|
2020-08-22 06:05:05 +00:00
|
|
|
|
|
|
|
telegram/functions/index
|
|
|
|
telegram/types/index
|
|
|
|
telegram/base/index
|