A lightweight, serverless Telegram bot that automatically forwards messages between channels — silently, without the "Forwarded From" tag. Deploy in minutes on Vercel with zero server management.
- 🔁 Silent Forwarding — Copies messages without "Forwarded From" header
- 📋 Multi-Rule Support — Forward from multiple sources to multiple targets in one config
- 🚫 Skip Terms — Filter out messages containing specific words or phrases
- ⚡ Serverless — Runs entirely on Vercel, no server required
- 🔒 Webhook Secret — Optional security token to protect your webhook endpoint
- 📝 Edited Posts — Also forwards edited channel posts
- 🤖 Bot Commands —
/startand/statusfor quick health checks
git clone https://github.com/MNTGXO/Auto-Forward-Bot.git
cd Auto-Forward-BotOr via CLI:
npm i -g vercel
vercelGo to Vercel → Project → Settings → Environment Variables and add:
| Variable | Required | Description |
|---|---|---|
BOT_TOKEN |
✅ Yes | Your bot token from @BotFather |
FORWARD_RULES |
✅ Yes | Forwarding rules (see format below) |
SKIP_TERMS |
❌ No | Comma-separated words to skip |
WEBHOOK_SECRET |
❌ No | Optional security token for webhook |
After deploying, open this URL in your browser (replace values):
https://api.telegram.org/bot<BOT_TOKEN>/setWebhook?url=https://<your-vercel-url>/api/webhook
You should receive:
{"ok": true, "result": true, "description": "Webhook was set"}SOURCE_ID:TARGET_ID
Multiple targets:
-100111111:-100222222,-100333333
Multiple rules (separated by ;):
-100111111:-100222222;-100444444:-100555555
Multiple sources to one target:
-100111111,-100222222:-100333333
💡 To get a channel ID, forward any message from the channel to @userinfobot
Comma or semicolon separated words/phrases. Any message containing these will be skipped:
spam,buy now,advertisement
Auto-Forward-Bot/
├── api/
│ ├── webhook.js # Main bot logic & Telegram webhook handler
│ └── index.js # Root health check endpoint
├── vercel.json # Vercel routing & function config
├── package.json
└── README.md
| Command | Description |
|---|---|
/start |
Check if the bot is online |
/status |
View rules count, skip terms, and token status |
Q: Does the bot show "Forwarded From" in the target channel?
No. It uses Telegram's copyMessage API which sends a clean copy with no forward header.
Q: Can I forward from multiple sources to multiple targets?
Yes. You can define as many rules as needed, separated by ; in FORWARD_RULES.
Q: The bot needs to be admin? The bot must be an admin with post permission in all target channels. For source channels, it only needs to be a member.
Q: What happens if Vercel's function times out?
The function has a maxDuration of 10 seconds. For most messages this is more than enough.
Having trouble? Join our support group:
If this project helped you, please consider leaving a ⭐ star on GitHub — it really helps!
MIT License — Free to use, modify, and distribute.