Skip to content

AnmolRatna25/PyroRatnaGram

Repository files navigation

PyroRatnaGram
Telegram MTProto API Framework for Python
Homepage Documentation Issues Support Chat News/Releases

PyroRatnaGram

Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots

from pyrogram import Client, filters

app = Client("my_account")


@app.on_message(filters.private)
async def hello(client, message):
    await message.reply("Hello from PyroRatnaGram!")


app.run()

PyroRatnaGram is a modern, elegant and asynchronous MTProto API 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.

Most Important Changes

  • KeyboardButton now supports style and icon_custom_emoji_id for richer reply keyboards.
  • Available ButtonStyle colors are PRIMARY (blue), DANGER (red), and SUCCESS (green).
  • Callback query handlers now support clear priority flow with group usage.
  • Documentation and project links were updated to the current PyroRatnaGram endpoints.

Breaking Changes

  • Package publishing identity is now pyroratnagram. Use pip3 install -U pyroratnagram for new installs and upgrades.
  • For private incoming text handlers, command exclusion should be moved to decorator-level filtering.

Old style:

@Client.on_message(filters.private & filters.text & filters.incoming)
async def pm_search(client, message):
    if str(message.text).startswith('/'):
        return

Recommended style:

@Client.on_message(filters.private & filters.text & filters.incoming & filters.regex(r"^(?!/)"))
async def pm_search(client, message):
    ...

Why this change matters: it prevents unnecessary handler execution, keeps handlers cleaner, and reduces logic duplication.

For the full list of updates, see CHANGELOG.md.

Key Features

  • Ready: Install PyroRatnaGram with pip and start building your applications right away.
  • Easy: Makes the Telegram API simple and intuitive, while still allowing advanced usages.
  • Elegant: Low-level details are abstracted and re-presented in a more convenient way.
  • Fast: Boosted up by TgCrypto, a high-performance cryptography library written in C.
  • Type-hinted: Types and methods are all type-hinted, enabling excellent editor support.
  • Async: Fully asynchronous (also usable synchronously if wanted, for convenience).
  • Powerful: Full access to Telegram's API to execute any official client action and more.

Installing

pip3 install -U pyroratnagram

Resources

  • Check out the docs at https://pyroratna.ratna.pw to learn more about PyroRatnaGram, get started right away and discover more in-depth material for building your client applications.
  • Join the official Telegram Channel at https://t.me/official_RATNA and stay tuned for news, updates and announcements.

About

Pyrogram fork with Adjustable web page preview, Quote Reply, Story & Topics Support, Mongodb session storage, and much more. go to https://pyroratna.ratna.pw for documentation. and go to https://pypi.org/project/pyroratnagram/ for official package

Topics

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.lesser
GPL-3.0
COPYING

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages