Go to file
ColinShark c5b7a365af
Add message.link attribute/property (#442)
* Add message.link attribute

Adds the functionality to access the message link.
Either as `t.me/c/` or `t.me/username` format.

* Change message.link logic

Property now has a returned type, list is a tuple and
we use `utils.get_channel_id` to not rely on str.replace

* Update message.py

- Prepend https:// like official clients do
- Use .format()

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2020-07-27 15:30:49 +02:00
.github Update bug_report.md 2019-08-16 14:40:25 +02:00
compiler Remove set_chat/profile_video 2020-07-27 15:03:23 +02:00
docs Update instructions for accessing test servers in tdesktop 2020-07-26 23:17:53 +02:00
examples Update Pyrogram's sticker file id 2020-07-27 15:12:24 +02:00
pyrogram Add message.link attribute/property (#442) 2020-07-27 15:30:49 +02:00
.gitignore Update .gitignore 2020-03-21 15:30:12 +01:00
COPYING Initial commit 2017-12-05 12:09:33 +01:00
COPYING.lesser Initial commit 2017-12-05 12:09:33 +01:00
MANIFEST.in Update errors prune path 2019-06-30 19:22:19 +02:00
NOTICE Update copyright notice 2020-02-01 14:04:33 +01:00
README.md Update copyright notice 2020-02-01 14:04:33 +01:00
requirements.txt Update requirements.txt 2020-03-30 11:41:12 +02:00
setup.py Drop [fast] setup directive 2020-03-30 11:47:25 +02:00

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!