A high-performance Telegram Userbot and Web Admin Dashboard built with Python, Telethon, and aiohttp to monitor, clone, transform, and mirror content between Telegram channels in real-time.
You can host TeleMirror Pro on Render so your bot runs 24/7 in the cloud with an online web dashboard at https://telemirror.onrender.com.
Cloud environments (like Render) require a headless Telethon StringSession so the bot can authenticate without asking for interactive SMS verification codes during automated cloud restarts.
Run the exporter tool locally:
python tools/export_session_string.py(Or open the local dashboard at http://localhost:8080, navigate to Settings, and click "Export From Active Login").
Copy the generated SESSION_STRING value.
Initialize git (if not already done) and push to your repository:
git init
git add .
git commit -m "Prepare TeleMirror for Render deployment"
git branch -M main
git remote add origin https://github.com/<your-username>/telemirror.git
git push -u origin mainNote
.gitignore automatically keeps your local .session SQLite files and .env safe and private.
- Go to Render Dashboard.
- Click New + -> Blueprint.
- Select your GitHub repository. Render will automatically detect
render.yaml. - Enter your environment variables:
SESSION_STRING: (Pasted from Step 1)API_ID: (Your Telegram API ID)API_HASH: (Your Telegram API Hash)PHONE_NUMBER: (Your phone number)
- Click Apply. Render will build and deploy your app.
- On Render Dashboard, click New + -> Web Service.
- Connect your Git repository.
- Configure the service settings:
- Name:
telemirror(This gives youtelemirror.onrender.com) - Language:
Python 3 - Build Command:
pip install -r requirements.txt - Start Command:
python main.py - Health Check Path:
/healthz
- Name:
- In the Environment Variables section, add:
Variable Value Description PORT10000Port automatically routed by Render SESSION_STRING(Your StringSession) Enables headless login API_ID21547934From https://my.telegram.org API_HASHyour_api_hashFrom https://my.telegram.org PHONE_NUMBER+1234567890Account phone number COPY_MODEclean_copyFresh post (no forward tag) MIRROR_EDITStrueSyncs edited messages - Click Create Web Service.
Once deployed, access your live dashboard at:
👉 https://telemirror.onrender.com
- Web UI: Full glassmorphism mobile & desktop interface.
- One-Click Bot Controls: Start, Stop, and Restart the Telethon userbot engine with live status indicators.
- Live Metrics & Stats: Track total messages processed, mirrored, skipped/filtered, and active channels in real time.
- Real-Time Terminal Streaming: Live WebSocket terminal logs inside the admin dashboard.
- Source Channels: Channels to collect posts from.
- Destination Channels: Target channels to post to.
- Telegram Channel Explorer: Click "Discover My Telegram Channels" to browse all channels/groups your account has joined and add them as source or destination with 1 click!
- 🔗 URL & Link Replacement:
- Global Link Override: Automatically replace every single URL in incoming posts with your preferred admin/promotion link (e.g.
https://t.me/my_admin_bot). - Specific Link Rules: Map specific links (
t.me/old_promo->https://t.me/my_affiliate_link). - Strip All Links: Automatically remove all links from outgoing posts.
- Global Link Override: Automatically replace every single URL in incoming posts with your preferred admin/promotion link (e.g.
- 👤 Username & Admin Handle Customization:
- Global Admin Handle: Replace all
@mentionswith your preferred@my_adminhandle. - Specific Handle Rules: Map
@old_support->@my_support. - Strip Usernames: Clean out any mention of source channels or administrators.
- Global Admin Handle: Replace all
- 🏷️ Word & Watermark Replacement: Replace unwanted brand names or text watermarks.
- 📢 Branding Header & Footer:
- Insert custom headers before every post (e.g.
🔥 <b>VIP SIGNALS ALERT</b> 🔥). - Insert custom footers with your contact details & promotion links (e.g.
👉 <b>Contact:</b> @my_admin | <b>Join VIP:</b> https://t.me/mychannel).
- Insert custom headers before every post (e.g.
- 🛡️ Keyword Filtering: Whitelist (only mirror matching posts) or Blacklist (block posts containing unwanted words).
- 🧪 Live Simulator: Live interactive sandbox to test how messages and links will be transformed before going live!
.
├── main.py # Primary launcher (binds to Render $PORT)
├── web_server.py # aiohttp async Web Server & /healthz check
├── bot_engine.py # Telethon engine with StringSession support
├── cleaner.py # Text transformer & link replacement engine
├── album_manager.py # Handler for multi-photo/video albums
├── settings_manager.py # Settings manager with env var & cloud priority
├── config.py # Config validator and legacy parser
├── render.yaml # Render Blueprint deployment definition
├── Procfile # Web service process configuration
├── .gitignore # Keeps sessions and secrets private
├── templates/
│ └── index.html # Modern Web Admin Dashboard
├── tools/
│ ├── export_session_string.py# StringSession exporter for Render
│ └── list_channels.py # CLI channel discovery tool
├── test_bot.py # Automated unit tests
├── requirements.txt # Python dependencies
└── settings.json # Active configuration storage
To verify that all URL replacements, username transformations, health check endpoints, and cloud session handlers work properly:
python test_bot.py