A Flask-based proxy server that bridges Telegram Bot API with your applications. This server handles webhook forwarding, API proxying, and file downloads while providing proper error handling, logging, and security features.
- 🔄 Webhook Forwarding: Forwards Telegram webhooks to your application
- 🔗 API Proxying: Proxies Telegram Bot API requests from Laravel
- 📁 File Downloads: Handles Telegram file downloads with proper security
- 🛡️ Security: Token validation
git clone https://github.com/miladniroee/telegram-bridge-server.git
cd telegram-bridge-server# Copy environment template
cp .env.example .env
# Edit environment variables
nano .envpip install -r requirements.txtpython app.py| Variable | Description | Default | Required |
|---|---|---|---|
TELEGRAM_BOT_TOKENS |
Your Telegram bot token(s) from @BotFather (comma-separated for multiple tokens) | - | ✅ |
APP_URL |
Your application webhook URL | - | ✅ |
GET /- Health check and server infoPOST /webhook- Telegram webhook receiverGET|POST /bot<token>/<method>- Telegram API proxyGET /file/bot<token>/<file_path>- File download proxy
POST /set-webhook- Set Telegram webhook URL
The application logs all requests and errors. In production, consider using structured logging:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Include logs and configuration (without sensitive data)