🔥 Pyromodify
Elegant, Modern & Asynchronous Telegram MTProto API Framework
A powerful fork of Pyrogram with built-in conversation handling, Pyromod-style flows, and modern Telegram Bot API support.
Features • Installation • Quick Start • Conversations • Handlers • Structure • License
✨ Features
|
⚡ Async-First Fully asynchronous architecture built on asyncio for high‑performance I/O
|
💬 Conversation Flow Built‑in Pyromod‑style ask(), listen(), and step handlers for interactive dialogs
|
🤖 Dual Mode Seamlessly works with both user accounts and bot accounts via MTProto |
🛡️ Type‑Safe Comprehensive type hints across all core modules for IDE autocomplete & safety |
|
🎯 20+ Handlers Message, callback, inline, reaction, story, poll, payment, and more event handlers |
📦 Rich Types Full coverage of Telegram types — messages, media, keyboards, business, stories |
🔐 Crypto Layer Built‑in encryption with optional PyTgCrypto and uvloop acceleration
|
📝 Sphinx Docs Auto-generated API reference with Sphinx, Furo theme, and copy‑button support |
📦 Installation
Stable Release
pip install pyromodify
Development Version
pip install git+https://github.com/Snowball-01/Pyromodify.git
With Performance Extras
pip install "pyromodify[fast]"
Note: The
fastextra installsPyTgCryptofor accelerated crypto operations anduvloopfor a faster event loop (Linux/macOS only).
🚀 Quick Start
Bot Example
from pyrogram import Client, filters
app = Client(
"my_bot",
api_id=123456,
api_hash="your_api_hash",
bot_token="123456:ABCDEF"
)
@app.on_message(filters.command("start") & filters.private)
async def start(client, message):
await message.reply(
"👋 **Hello!** Welcome to my bot.\n"
"Powered by **Pyromodify**."
)
app.run()
Userbot Example
from pyrogram import Client, filters
app = Client(
"my_account",
api_id=123456,
api_hash="your_api_hash"
)
@app.on_message(filters.me & filters.command("ping", prefixes="."))
async def ping(client, message):
await message.edit_text("🏓 **Pong!**")
app.run()
💬 Conversation Flow
One of Pyromodify's standout features is its built‑in conversation support — no extra plugins required.
ask() — Prompt and Wait
@app.on_message(filters.command("survey"))
async def survey(client, message):
# Ask a question and wait for the user's response
response = await message.chat.ask("What is your name?")
name = response.text
response = await message.chat.ask(f"Nice to meet you, {name}! How old are you?")
age = response.text
await message.reply(f"✅ Got it! **{name}**, age **{age}**.")
listen() — Wait for Any Update
@app.on_message(filters.command("wait"))
async def wait_example(client, message):
await message.reply("Send me a photo within 30 seconds!")
response = await client.listen(
chat_id=message.chat.id,
filters=filters.photo,
timeout=30
)
await response.reply("📸 Photo received!")
wait_for_callback_query() — Inline Button Response
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
@app.on_message(filters.command("choose"))
async def choose(client, message):
keyboard = InlineKeyboardMarkup([
[InlineKeyboardButton("Option A", callback_data="a"),
InlineKeyboardButton("Option B", callback_data="b")]
])
await message.reply("Pick one:", reply_markup=keyboard)
cb = await client.wait_for_callback_query(message.chat.id)
await cb.answer(f"You picked: {cb.data.upper()}", show_alert=True)
register_next_step_handler() — Step‑Based Flows
@app.on_message(filters.command("multistep"))
async def step_one(client, message):
await message.reply("Step 1: Send your email address.")
client.register_next_step_handler(message, step_two)
async def step_two(client, message):
email = message.text
await message.reply(f"Got **{email}**. Now send your phone number.")
client.register_next_step_handler(message, step_three)
async def step_three(client, message):
phone = message.text
await message.reply(f"✅ Registration complete! Phone: **{phone}**")
🎛️ Handler Reference
Pyromodify ships with 20+ event handlers covering every Telegram update type:
| Handler | Decorator | Description |
|---|---|---|
MessageHandler |
@on_message |
New incoming/outgoing messages |
EditedMessageHandler |
@on_edited_message |
Edited messages |
DeletedMessagesHandler |
@on_deleted_messages |
Deleted messages |
CallbackQueryHandler |
@on_callback_query |
Inline button presses |
InlineQueryHandler |
@on_inline_query |
Inline mode queries |
ChosenInlineResultHandler |
@on_chosen_inline_result |
Chosen inline results |
ChatMemberUpdatedHandler |
@on_chat_member_updated |
Chat member status changes |
ChatJoinRequestHandler |
@on_chat_join_request |
Join requests |
MessageReactionUpdatedHandler |
@on_message_reaction_updated |
Message reactions |
MessageReactionCountUpdatedHandler |
@on_message_reaction_count_updated |
Reaction count changes |
StoryHandler |
@on_story |
Stories |
PollHandler |
@on_poll |
Poll updates |
UserStatusHandler |
@on_user_status |
Online/offline status |
ConversationHandler |
— | Pyromod conversation flow |
PreCheckoutQueryHandler |
@on_pre_checkout_query |
Pre-checkout payment queries |
ShippingQueryHandler |
@on_shipping_query |
Shipping queries |
PurchasedPaidMediaHandler |
@on_bot_purchased_paid_media |
Purchased paid media |
BusinessBotConnectionHandler |
@on_bot_business_connection |
Business bot connections |
RawUpdateHandler |
@on_raw_update |
Raw MTProto updates |
DisconnectHandler |
@on_disconnect |
Client disconnect events |
🏗️ Project Structure
Pyromodify/
├── pyrogram/ # Core library
│ ├── client.py # Main Client class
│ ├── dispatcher.py # Update dispatcher engine
│ ├── filters.py # Message & update filters
│ ├── sync.py # idle() & compose() utilities
│ ├── utils.py # Internal helpers
│ ├── file_id.py # Telegram file ID parser
│ ├── handlers/ # 20+ event handlers
│ │ ├── message_handler.py
│ │ ├── callback_query_handler.py
│ │ ├── conversation_handler.py
│ │ └── ...
│ ├── methods/ # Client API methods
│ │ ├── messages/ # Send, edit, delete messages
│ │ ├── chats/ # Chat management
│ │ ├── users/ # User info & actions
│ │ ├── bots/ # Bot-specific methods
│ │ ├── pyromod/ # ask(), listen(), step handlers
│ │ ├── decorators/ # @on_message, @on_callback, ...
│ │ ├── stickers/ # Sticker operations
│ │ ├── stories/ # Stories
│ │ ├── business/ # Business features
│ │ └── ...
│ ├── types/ # Telegram type definitions
│ │ ├── messages_and_media/ # Message, Photo, Video, ...
│ │ ├── user_and_chats/ # User, Chat, ChatMember, ...
│ │ ├── bots_and_keyboards/ # InlineKeyboard, ReplyKeyboard
│ │ ├── inline_mode/ # InlineQuery, InlineResult
│ │ ├── pyromod/ # Listener, Identifier
│ │ └── ...
│ ├── enums/ # Enumerations (ChatType, ParseMode, ...)
│ ├── errors/ # Telegram error mapping
│ ├── connection/ # TCP/Transport layer
│ ├── session/ # MTProto session management
│ ├── storage/ # SQLite session storage
│ ├── crypto/ # Encryption utilities
│ ├── parser/ # HTML & Markdown parsers
│ └── raw/ # Auto-generated TL schema bindings
├── compiler/ # TL schema & docs compilers
│ ├── api/ # API schema compiler
│ ├── errors/ # Error code compiler
│ └── docs/ # Documentation compiler
├── tests/ # Test suite (pytest)
├── docs/ # Sphinx documentation source
├── pyproject.toml # Project metadata & build config
├── hatch_build.py # Custom Hatch build hook
├── Makefile # Development shortcuts
├── COPYING # GPL-3.0 license
├── COPYING.lesser # LGPL-3.0 license
└── NOTICE # Attribution notice
⚙️ Requirements
| Requirement | Details |
|---|---|
| Python | >= 3.9 (CPython or PyPy) |
| API Credentials | api_id + api_hash from my.telegram.org |
| Bot Token | From @BotFather (for bot mode only) |
Core Dependencies
| Package | Purpose |
|---|---|
pyaes |
AES encryption (<=1.6.1) |
pysocks |
SOCKS proxy support (<=1.7.1) |
Optional Extras
# Speed boost (PyTgCrypto + uvloop)
pip install "pyromodify[fast]"
# Documentation generation
pip install "pyromodify[docs]"
# Development tools (pytest, hatch, twine)
pip install "pyromodify[dev]"
📖 Documentation
Full API documentation is built with Sphinx using the Furo theme.
Build Locally
# Create virtual environment & install deps
make venv
# Generate API reference + build HTML docs
make docs
# Live-reload mode for development
make docs-live
The generated docs will be available at docs/build/html/index.html.
🤝 Contributing
Contributions are welcome! Here's how to get started:
# Clone the repository
git clone https://github.com/Snowball-01/Pyromodify.git
cd Pyromodify
# Create a virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
📄 License
Pyromodify is licensed under the GNU Lesser General Public License v3.0 (LGPL-3.0).
This means you can:
- ✅ Use it in proprietary projects
- ✅ Modify and distribute it
- ⚠️ Changes to the library itself must remain open-source
See COPYING and COPYING.lesser for full terms.
🔗 Links
Made with ❤️ by the Snowball-01 team
If you find Pyromodify useful, consider giving it a ⭐ on GitHub!
Metadata
Release files for pyromodify 2.3.22
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyromodify-2.3.22.tar.gz | 568.5 kB | Without provenance | Details for pyromodify-2.3.22.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyromodify-2.3.22-py3-none-any.whl | Python 3 | none | any | Details for pyromodify-2.3.22-py3-none-any.whl |
Total release size: 6.1 MB
Release files / pyromodify-2.3.22.tar.gz
| Download URL | pyromodify-2.3.22.tar.gz |
|---|---|
| Size | 568.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
efa551f388f6f9c79c40efa7f5274f153725ef239636d4b855803435c2167523
|
|
BLAKE2b-256 checksum How to use checksums |
c70f18c2d152610df38b8822b3734f58634b9a54dc2e5d73f64387402bcb7aa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.6
|
Release files / pyromodify-2.3.22-py3-none-any.whl
| Download URL | pyromodify-2.3.22-py3-none-any.whl |
|---|---|
| Size | 5.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cba8e18c6bdc6d6169138bbdab0cc45ba721c5579a48615e52ef7ef74cf5d9e0
|
|
BLAKE2b-256 checksum How to use checksums |
734ff3ba10fad806eb71ab543af7d0a234ab665d3c9e507415b94994a5f2df41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.6
|
Security for pyromodify 2.3.22
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.