Go to file
Dan 64939e5289 Update Document file ids to make them compatible again with the Bot API
Telegram changed something server side on 29 July, 2019 starting
exactly at 04:00 AM UTC+1 (DST), logs say. Looks like Document file ids,
just like Photo-like ids, are going to change as well after all, if we
want to keep them compatible with the Bot API
2019-08-02 01:15:01 +02:00
.github
compiler Remove Null primitive 2019-08-01 18:41:04 +02:00
docs Update faq.rst 2019-08-01 17:26:59 +02:00
examples
pyrogram Update Document file ids to make them compatible again with the Bot API 2019-08-02 01:15:01 +02:00
.gitignore
COPYING
COPYING.lesser
MANIFEST.in
NOTICE
README.md
requirements.txt
setup.py

Pyrogram
Telegram MTProto API Framework for Python
Documentation Releases Community

Pyrogram

from pyrogram import Client, Filters

app = Client("my_account")


@app.on_message(Filters.private)
def hello(client, message):
    message.reply_text("Hello {}".format(message.from_user.first_name))


app.run()

Pyrogram is an elegant, easy-to-use Telegram client library and framework written from the ground up in Python and C. It enables you to easily create custom apps for both user and bot identities (bot API alternative) via the MTProto API.

Pyrogram in fully-asynchronous mode is also available »

Working PoC of Telegram voice calls using Pyrogram »

Features

  • Easy: You can install Pyrogram with pip and start building your applications right away.
  • Elegant: Low-level details are abstracted and re-presented in a much nicer and easier way.
  • Fast: Crypto parts are boosted up by TgCrypto, a high-performance library written in pure C.
  • Documented: Pyrogram API methods, types and public interfaces are well documented.
  • Type-hinted: Exposed Pyrogram types and method parameters are all type-hinted.
  • Updated, to make use of the latest Telegram API version and features.
  • Bot API-like: Similar to the Bot API in its simplicity, but much more powerful and detailed.
  • Pluggable: The Smart Plugin system allows to write components with minimal boilerplate code.
  • Comprehensive: Execute any advanced action an official client is able to do, and even more.

Requirements

Installing

pip3 install pyrogram

Resources

Contributing

Pyrogram is brand new, and you are welcome to try it and help make it even better by either submitting pull requests or reporting issues/bugs as well as suggesting best practices, ideas, enhancements on both code and documentation. Any help is appreciated!