<p align="center">
    <a href="https://github.com/AnmolRatna25/PyroRatnaGram">
        <img src="./pyroratna.png" alt="PyroRatnaGram" width="128">
    </a>
    <br>
    <b>Telegram MTProto API Framework for Python</b>
    <br>
    <a href="https://github.com/AnmolRatna25">
        Homepage
    </a>
    •
    <a href="https://pyroratna.ratna.pw">
        Documentation
    </a>
    •
    <a href="https://github.com/AnmolRatna25/PyroRatnaGram/issues">
        Issues
    </a>
    •
    <a href="https://t.me/RATNA_Robot">
        Support Chat
    </a>
    •
    <a href="https://t.me/official_RATNA">
        News/Releases
    </a>
</p>

## PyroRatnaGram

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

``` python
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](https://pyroratna.ratna.pw/main/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.

### 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:

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

Recommended style:

```python
@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](./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](https://github.com/pyrogram/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

``` bash
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.
