How xcyclonev3/pyrofork works
Pyrogram is an asynchronous Python client framework for Telegram’s MTProto API, usable with user accounts and bots. A user or bot configures a Client, authenticates, then calls high-level methods or registers handlers; updates are dispatched to filtered callbacks, while API requests travel through session, transport, and cryptographic layers to Telegram. The graph also preserves the broad messaging, bot/business, chat, and payment method domains documented by the repository. Source excerpts are partial, so unverified internal links are omitted or shown as dashed.
Main entry points: client.py Client lifecycle · raw Raw API schema · session.py MTProto session · handler.py Typed handlers
Components 21
Client and API
- Client lifecycle
pyrogram/client.py - Authentication
pyrogram/methods/auth - Messages and media
pyrogram/methods/messages - Chats and communities
pyrogram/methods/chats - Bot and business APIs
pyrogram/methods/bots - Payments and wallets
pyrogram/methods/payments
Update handling
- Update dispatcher
pyrogram/dispatcher.py - Typed handlers
pyrogram/handlers/handler.py - Filters
pyrogram/filters.py
MTProto transport
- MTProto session
pyrogram/session/session.py - Connection transport
pyrogram/connection/connection.py - MTProto cryptography
pyrogram/crypto/mtproto.py - AES primitives
pyrogram/crypto/aes.py
Types and domains
- Telegram types
pyrogram/types - Raw API schema
pyrogram/raw - Session storage
pyrogram/storage - File identifiers
pyrogram/file_id.py - Emoji utilities
pyrogram/emoji.py - Enums
pyrogram/enums/auto_name.py
Other components
- Application developer
- Telegram
Connections 26
- Application developer → Client lifecycle: configures
- Client lifecycle → Authentication: authenticates via
- Application developer → Messages and media: calls methods
- Application developer → Chats and communities: calls methods
- Application developer → Bot and business APIs: calls methods
- Application developer → Payments and wallets: calls methods
- Client lifecycle → Update dispatcher: queues updates
pyrogram/client.py - Update dispatcher → Typed handlers: dispatches updates
- Typed handlers → Filters: checks filters
pyrogram/handlers/handler.py - Typed handlers → Application developer: runs callbacks
pyrogram/handlers/handler.py - Client lifecycle → Session storage: persists session
pyrogram/client.py - Client lifecycle → MTProto session: starts session
pyrogram/client.py - MTProto session → Connection transport: uses transport
pyrogram/session/session.py - MTProto session → MTProto cryptography: encrypts messages
pyrogram/session/session.py - MTProto cryptography → AES primitives: uses AES
pyrogram/crypto/mtproto.py - MTProto session → Raw API schema: encodes requests
pyrogram/session/session.py - Messages and media → Raw API schema: issues API calls
- Chats and communities → Raw API schema: issues API calls
- Bot and business APIs → Raw API schema: issues API calls
pyrogram/methods/bots/answer_inline_query.py - Payments and wallets → Raw API schema: issues API calls
- Raw API schema → Telegram: exchanges protocol data
- Telegram → Client lifecycle: returns updates
- Telegram types → Application developer: exposes objects
- Client lifecycle → File identifiers: uses identifiers
pyrogram/client.py - Client lifecycle → Emoji utilities: exposes utilities
pyrogram/__init__.py - Client lifecycle → Enums: exposes enums