This project allows users to connect their Telegram accounts to an automated system that reads and responds to incoming messages based on specified patterns.
-
🔐 Secure Session Handling
Each user connects via their own Telegram session for full privacy.
-
🤖 Auto-Responder Logic
Automatically replies to messages that match a specified pattern (e.g., codes, product inquiries, etc.).
-
🧠 Custom Pattern Matching
Easily define what message formats trigger a response.
-
📦 Multi-Account Support
Works with multiple Telegram accounts independently.
-
📊 Logging and Tracking
Messages are marked as resolved and responses are logged.
- User uploads their Telegram session file (
.madelineor similar). - The system reads new messages.
- If a message matches a pre-defined pattern (e.g.,
ABC-123), it sends an automated reply. - The message is marked as answered and stored in the log.
telegram-auto-responder/
├── sessions/ # Stores Telegram session files
├── src/
│ ├── MessageHandler.php # Core logic to match and respond
│ ├── BotRunner.php # Initializes and runs the bot
├── views/ # UI and upload forms
├── public/ # Entry point and assets
├── README.md
└── composer.json
- Clone the repository
git clone https://github.com/MahdiRezaeiDev/telegram-assistant.git
cd telegram-assistant- Install dependencies
composer install- Set write permissions (for sessions)
chmod -R 755 views/telegram/sessions- Run the system
You can start the bot via a PHP entry file (e.g., index.php) or schedule it via cron for periodic checks.
- PHP 8.0+
- Composer
- MadelineProto
- This project does not use Telegram Bot API . It uses MadelineProto , which provides full access like a real Telegram user.
- Make sure to follow Telegram's Terms of Service when automating responses.
MIT License © 2025 [Mahdi Rezaei]