A Telegram bot built using Pyrogram that can forward messages and media albums from multiple source chats to target chats — intelligently, reliably, and with Docker support 🚀
- 🔄 Forward messages from multiple source ➝ target chat pairs
- 🖼️ Auto-forward media groups (albums) as proper Telegram albums
- 📝 Captions preserved for media or text messages
- 🧠 Smart buffering to ensure complete albums are captured
- 💬 Also supports text-only messages
- 🐳 Runs inside Docker or with docker-compose
- 🔐 Clean logging and graceful shutdowns
Because albums deserve better.
There are tons of forwarding bots — but most of them ruin media albums. This one doesn’t. Built to forward like a pro, without turning your albums into a slideshow gone wrong.
.
├── main.py # Bot logic
├── config.py # Bot configs
├── map_utils.py # Map logic
├── mappings.json # Json with source ➝ target mappings
├── requirements.txt # Python dependencies
├── Dockerfile # Docker image definition
├── docker-compose.yml # Docker Compose setup
└── README.md # You're here 😎
Edit config.py
to define your Telegram API credentials and forward rules:
API_ID = 123456
API_HASH = "your_api_hash"
BOT_TOKEN = "your_bot_token"
OWNER_ID = [123456789, 987654321] # Replace with your actual Telegram user IDs
🔁 Use channel/group IDs (must be numeric). You can get IDs using bots like @getidsbot
Install dependencies and run:
pip install -r requirements.txt
python main.py
docker-compose build
docker-compose up -d
docker-compose logs -f
docker-compose down
2025-07-08 16:03:12 - INFO - __main__ - Bot Started!
2025-07-08 16:04:28 - INFO - __main__ - Forwarded album to -1009876543210
2025-07-08 16:05:47 - INFO - __main__ - Forwarded text message
2025-07-08 16:06:14 - INFO - __main__ - Bot Stopped
Have an idea or a feature request? PRs are most welcome!
Feel free to fork, experiment, and open a pull request — let’s make this bot even better together 💡
- Built with PyroFork
- Uses
copy_media_group()
andmessage.copy()
for best forwarding behavior - Inspired by real-world automation needs!
This project is released under the MIT License.