Welcome to MadelineProto
MadelineProto is a fully async PHP library that allows you to interact with Telegram’s MTProto API directly - without the limitations of the Bot API. Build powerful bots, userbots, and automation tools with the same capabilities as official Telegram clients.Approved by Telegram! MadelineProto is officially recognized and trusted by Telegram.
Why MadelineProto?
MadelineProto gives you direct access to Telegram’s MTProto protocol, enabling capabilities that go far beyond the standard Bot API:True MTProto Access
Communicate directly with Telegram’s servers using the same protocol as official apps - no Bot API limitations
Fully Async Architecture
Built on AMPHP for incredible speed and parallel processing. Handle thousands of operations simultaneously
User & Bot Support
Login as a user with phone number, bot with token, or even via QR code. Build userbots and bots with the same codebase
Advanced Features
VoIP calls, secret chats, Stories, 4GB file uploads, custom filters, plugins, and much more
What Can You Build?
Powerful Bots
Create feature-rich Telegram bots with event handlers, filters, and plugins
File Management
Upload and download files up to 4GB with parallel processing and progress tracking
VoIP Integration
Make and receive Telegram voice calls programmatically with audio streaming
Secret Chats
Work with end-to-end encrypted secret chats with full MTProto support
Key Features
- Full MTProto API Access: Every method available in official Telegram apps
- Async/Await: Powered by AMPHP v3 and PHP fibers for non-blocking operations
- Event-Driven Architecture: Handle updates with filters, attributes, and plugins
- Database Support: Optional MySQL, PostgreSQL, or Redis backend for reduced RAM usage
- File Operations: Upload/download files up to 4GB with bot API file ID support
- Prometheus Metrics: Built-in monitoring and metrics collection
- Docker Ready: Official Docker images for amd64, arm64, and riscv64
Quick Example
Here’s how simple it is to create a bot that responds to messages:Real-World Examples
These open-source projects showcase MadelineProto’s capabilities:- @tgstories_dl_bot - Download any Telegram Story
- magnaluna webradio - Full-featured VoIP webradio
- downloadRenameBot - Download and rename files with parallel processing
- pipesbot - Use inline bots via a userbot
Core Components
MadelineProto’s architecture is built on standalone, reusable components:- danog/async-orm - Async ORM for data persistence
- danog/telegram-entities - Work with Telegram styled text
- danog/loop - Actor model abstraction for AMPHP
- danog/better-prometheus - Prometheus metrics
- danog/ipc - Async IPC for multi-process bots
Ready to Start?
Quick Start
Build your first bot in under 5 minutes
Installation
Install via Composer or PHAR
Requirements
Check system requirements and PHP extensions
API Documentation
Explore the complete API reference
Community & Support
- Official Channel: @MadelineProto
- Support Group: Join here
- Creator: Daniil Gentili
- License: AGPL-3.0