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-19 19:40:41 +00:00
|
|
|
<a href="https://docs.pyrogram.org">
|
2018-09-19 09:58:48 +00:00
|
|
|
<div><img src="_static/logo.png" alt="Pyrogram Logo"></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>
|
2019-05-10 14:14:10 +00:00
|
|
|
<a href="https://github.com/pyrogram/pyrogram">
|
2019-05-17 23:45:01 +00:00
|
|
|
Source Code
|
2018-01-13 16:09:25 +00:00
|
|
|
</a>
|
|
|
|
•
|
2019-01-24 19:03:14 +00:00
|
|
|
<a href="https://github.com/pyrogram/pyrogram/releases">
|
2019-05-13 16:04:44 +00:00
|
|
|
Releases
|
2018-01-13 16:09:25 +00:00
|
|
|
</a>
|
|
|
|
•
|
2019-05-17 23:45:01 +00:00
|
|
|
<a href="https://t.me/Pyrogram">
|
|
|
|
Community
|
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
|
|
|
|
|
|
|
|
from pyrogram import Client, Filters
|
|
|
|
|
|
|
|
app = Client("my_account")
|
|
|
|
|
|
|
|
|
|
|
|
@app.on_message(Filters.private)
|
|
|
|
def hello(client, message):
|
2018-06-23 12:25:19 +00:00
|
|
|
message.reply("Hello {}".format(message.from_user.first_name))
|
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
|
|
|
|
2019-05-12 17:26:55 +00:00
|
|
|
**Pyrogram** is an elegant, easy-to-use Telegram_ client library and framework written from the ground up in Python and
|
2019-05-13 16:04:44 +00:00
|
|
|
C. It enables you to easily create custom apps for both user and bot identities (bot API alternative) via the
|
2019-05-12 17:26:55 +00:00
|
|
|
`MTProto API`_.
|
2018-01-06 11:18:15 +00:00
|
|
|
|
2019-05-12 17:26:55 +00:00
|
|
|
.. _Telegram: https://telegram.org
|
2019-05-19 19:40:41 +00:00
|
|
|
.. _MTProto API: topics/mtproto-vs-botapi#what-is-the-mtproto-api
|
2019-05-12 17:26:55 +00:00
|
|
|
|
|
|
|
How the Documentation is Organized
|
2019-05-10 14:14:10 +00:00
|
|
|
----------------------------------
|
|
|
|
|
2019-05-12 17:26:55 +00:00
|
|
|
Contents are organized into self-contained topics and can be all accessed from the sidebar, or by following them in
|
2019-05-13 16:04:44 +00:00
|
|
|
order using the Next button at the end of each page. Here below you can, instead, find a list of the most relevant
|
2019-05-16 19:28:34 +00:00
|
|
|
pages for a quick access.
|
2019-05-12 17:26:55 +00:00
|
|
|
|
2019-05-17 23:45:01 +00:00
|
|
|
First Steps
|
|
|
|
^^^^^^^^^^^
|
2019-05-12 17:26:55 +00:00
|
|
|
|
2019-05-17 23:45:01 +00:00
|
|
|
- `Quick Start`_ - Overview to get you started quickly.
|
|
|
|
- `Calling Methods`_ - How to call Pyrogram's methods.
|
2019-05-12 17:26:55 +00:00
|
|
|
- `Handling Updates`_ - How to handle Telegram updates.
|
|
|
|
- `Error Handling`_ - How to handle API errors correctly.
|
|
|
|
|
2019-05-19 19:40:41 +00:00
|
|
|
.. _Quick Start: intro/quickstart
|
2019-05-12 17:26:55 +00:00
|
|
|
.. _Calling Methods: start/invoking
|
|
|
|
.. _Handling Updates: start/updates
|
|
|
|
.. _Error Handling: start/errors
|
|
|
|
|
|
|
|
API Reference
|
|
|
|
^^^^^^^^^^^^^
|
2019-05-17 23:45:01 +00:00
|
|
|
|
|
|
|
- `Client Class`_ - Reference details about the Client class.
|
2019-05-12 17:26:55 +00:00
|
|
|
- `Available Methods`_ - A list of available high-level methods.
|
|
|
|
- `Available Types`_ - A list of available high-level types.
|
2019-05-16 19:28:34 +00:00
|
|
|
- `Bound Methods`_ - A list of convenient bound methods.
|
2019-05-10 14:14:10 +00:00
|
|
|
|
2019-05-13 16:04:44 +00:00
|
|
|
.. _Client Class: api/client
|
|
|
|
.. _Available Methods: api/methods
|
|
|
|
.. _Available Types: api/types
|
2019-05-16 19:28:34 +00:00
|
|
|
.. _Bound Methods: api/bound-methods
|
2018-01-06 11:18:15 +00:00
|
|
|
|
2019-05-19 19:40:41 +00:00
|
|
|
Meta
|
|
|
|
^^^^
|
2018-01-06 11:18:15 +00:00
|
|
|
|
2019-05-12 17:26:55 +00:00
|
|
|
- `Pyrogram FAQ`_ - Answers to common Pyrogram questions.
|
2019-05-16 19:28:34 +00:00
|
|
|
- `Pyrogram Glossary`_ - A list of words with brief explanations.
|
2019-05-19 19:40:41 +00:00
|
|
|
- `Release Notes`_ - Release notes for Pyrogram releases.
|
|
|
|
- `Powered by Pyrogram`_ - A collection of Pyrogram Projects.
|
|
|
|
- `Support Pyrogram Development`_ - Ways to show your appreciation.
|
2019-05-12 17:26:55 +00:00
|
|
|
|
2019-05-19 19:40:41 +00:00
|
|
|
.. _Pyrogram FAQ: meta/faq
|
|
|
|
.. _Pyrogram Glossary: meta/glossary
|
|
|
|
.. _Release Notes: meta/releases
|
|
|
|
.. _Powered by Pyrogram: meta/powered-by
|
|
|
|
.. _Support Pyrogram Development: meta/support-pyrogram
|
2018-03-26 01:58:10 +00:00
|
|
|
|
2018-01-06 11:18:15 +00:00
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
2019-05-10 14:14:10 +00:00
|
|
|
:caption: Introduction
|
2018-01-06 11:18:15 +00:00
|
|
|
|
2019-05-19 19:40:41 +00:00
|
|
|
intro/quickstart
|
2019-05-10 14:14:10 +00:00
|
|
|
intro/install
|
|
|
|
intro/setup
|
2019-05-12 17:26:55 +00:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:caption: Getting Started
|
|
|
|
|
2019-05-19 19:40:41 +00:00
|
|
|
start/auth
|
2019-05-12 17:26:55 +00:00
|
|
|
start/invoking
|
|
|
|
start/updates
|
|
|
|
start/errors
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:caption: API Reference
|
|
|
|
|
|
|
|
api/client
|
|
|
|
api/methods
|
|
|
|
api/types
|
2019-05-16 19:28:34 +00:00
|
|
|
api/bound-methods
|
2019-05-12 17:26:55 +00:00
|
|
|
api/handlers
|
|
|
|
api/decorators
|
|
|
|
api/filters
|
|
|
|
api/errors
|
2018-01-06 11:18:15 +00:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
2019-05-10 14:14:10 +00:00
|
|
|
:caption: Topic Guides
|
|
|
|
|
2019-05-12 17:26:55 +00:00
|
|
|
topics/filters
|
2019-05-10 14:14:10 +00:00
|
|
|
topics/more-on-updates
|
2019-05-12 17:26:55 +00:00
|
|
|
topics/config-file
|
2019-05-10 14:14:10 +00:00
|
|
|
topics/smart-plugins
|
2019-05-12 17:26:55 +00:00
|
|
|
topics/auto-auth
|
|
|
|
topics/session-settings
|
2019-05-10 14:14:10 +00:00
|
|
|
topics/tgcrypto
|
|
|
|
topics/text-formatting
|
2019-05-12 17:26:55 +00:00
|
|
|
topics/proxy
|
2019-05-10 14:14:10 +00:00
|
|
|
topics/bots-interaction
|
2019-05-19 19:40:41 +00:00
|
|
|
topics/mtproto-vs-botapi
|
2019-05-10 14:14:10 +00:00
|
|
|
topics/test-servers
|
|
|
|
topics/advanced-usage
|
|
|
|
topics/voice-calls
|
2019-05-19 19:40:41 +00:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:caption: Meta
|
|
|
|
|
|
|
|
meta/faq
|
|
|
|
meta/glossary
|
|
|
|
meta/releases
|
|
|
|
meta/powered-by
|
|
|
|
meta/support-pyrogram
|
2018-01-03 17:26:05 +00:00
|
|
|
|
|
|
|
.. toctree::
|
2018-01-06 11:18:15 +00:00
|
|
|
:hidden:
|
|
|
|
:caption: Telegram API
|
2018-01-03 17:26:05 +00:00
|
|
|
|
2019-05-12 17:26:55 +00:00
|
|
|
telegram/functions/index
|
2019-05-13 13:57:49 +00:00
|
|
|
telegram/types/index
|