Quick Start Guide
Get a working Telegram bot up and running in minutes. This guide will walk you through creating a simple bot that responds to messages.Prerequisites
Before starting, ensure you have:- PHP 8.2+ (64-bit) installed
- Basic knowledge of PHP
- A Telegram account or bot token
New to MadelineProto? Check the Requirements page first to ensure your system is ready.
Your First Bot
Let’s create a simple bot that responds to all incoming messages.Login
Choose your login method:A session file (
- Bot Token
- Phone Number
Enter your bot token from @BotFather:
bot.madeline) will be created. Next time you run the bot, it will use this session.Adding Commands
Let’s enhance the bot with command handling using filters:Working with Media
Here’s how to handle photos and files:Using Filters
MadelineProto offers powerful filtering with PHP attributes and intersection types:Background Execution
For production, run your bot in the background:- screen (Simple)
- systemd (Recommended)
- Docker
Complete Example
Here’s a fully-featured bot with multiple handlers:Next Steps
Handling Updates
Learn about event handlers, filters, and update processing
File Operations
Upload and download files up to 4GB
Database Setup
Configure MySQL, PostgreSQL, or Redis for reduced RAM usage
API Reference
Explore the full MTProto API documentation
Common Patterns
Sending formatted messages
Sending formatted messages
Working with buttons
Working with buttons
Getting user information
Getting user information
Need help? Join the MadelineProto support group or check out more examples in the GitHub repository.