https://github.com/viperadnan-git/telegram-forwarder-bot
Forward Telegram messages between chats using Telegram Bot API and Webhooks
https://github.com/viperadnan-git/telegram-forwarder-bot
forward-messages telegram telegram-bot telegram-bot-api telegram-bots telegram-copier telegram-forward-bot telegram-forwarder telegram-message-forwarder telegram-messages telegram-webhook
Last synced: 4 months ago
JSON representation
Forward Telegram messages between chats using Telegram Bot API and Webhooks
- Host: GitHub
- URL: https://github.com/viperadnan-git/telegram-forwarder-bot
- Owner: viperadnan-git
- License: gpl-3.0
- Created: 2023-12-23T12:04:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-12T19:52:24.000Z (5 months ago)
- Last Synced: 2026-01-13T00:45:01.773Z (5 months ago)
- Topics: forward-messages, telegram, telegram-bot, telegram-bot-api, telegram-bots, telegram-copier, telegram-forward-bot, telegram-forwarder, telegram-message-forwarder, telegram-messages, telegram-webhook
- Language: TypeScript
- Homepage: https://t.me/echoitbot
- Size: 124 KB
- Stars: 52
- Watchers: 1
- Forks: 61
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Telgram Message Forwarder Bot
A simple telegram bot to forward messages from one channel to another channel or group. Written in pure Telegram Bot API using grammy framework.
This bot uses webhooks to receive updates from telegram servers. So, you need a server with a public IP address and a domain name to run this bot. This bot can be deployed on serverless platforms like Vercel, Render, Cyclic etc.
## Features
- Forward messages from one channel to another channel or group
- Forward messages from multiple channels to multiple channels or groups
- Forward messages from multiple channels to a single channel or group
- Forward messages from a single channel to multiple channels or groups
- Configurations through commands
- Owner only commands, so no one can misuse the bot
- Easy to clone and create your own bot withing minutes
- Control forwarding behavior via bot name (protect content, remove captions)
## Commands
- `/start` - Start the bot
- `/help` - Show help message
- `/set` - Add a channel to forward messages from
- `/rem` - Remove a channel from forwarding messages
- `/get` - List all the channels added
- `/set_owner` - Set the owner of the bot
## Bot Name Modifiers
You can control forwarding behavior by adding special characters to your bot's name (via [BotFather](https://t.me/BotFather)):
- `~` - Enable protected content (forwarded messages cannot be forwarded further or saved)
- `|` - Remove captions from forwarded messages
For example, if your bot is named `MyForwarder~`, all forwarded messages will have content protection enabled. You can combine modifiers, e.g., `MyBot~|` for both protected content and no captions.
## Configurations
Configurations are added in environment variables or [`.env.sample`](./.env.sample) file and rename it to `.env`. The following environment variables are required to run the bot.
- `BOT_TOKEN` - Telegram bot token received from [BotFather](https://t.me/BotFather)
- `REDIS_URI` - Redis database URI to store the channel ids. You can use [Redis Labs](https://redislabs.com/) to get a free Redis database
- `WEBHOOK_HOST` - URL of the server where the bot is running
## Deploying
### Deploying on Vercel, Render, Cyclic, Heroku etc.
- Fork this repository
- Create a new app on the platform you want to deploy
- Connect your forked repository to the app
- Set environment variables in the project settings
- (Optional) Set the `PORT` environment variable to the port number provided by the platform or set it to 3000
### Self-Hosting
Not recommended for beginners.
Note: You need SSL certificates and a public IP address to run the bot. As this bot works on webhooks, you need a domain name to set the webhook URL. You can use [Cloudflare Tunnel](https://try.cloudflare.com/) to get a free temporary domain name and SSL certificates.
#### Using Docker
- Clone this repository
```sh
git clone
cd
```
- Create a `.env` file with your environment variables (see [`.env.sample`](./.env.sample))
- Run with Docker Compose
```sh
docker-compose up -d
```
Or build and run manually:
```sh
docker build -t telegram-forwarder-bot .
docker run -d --env-file .env -p 3000:3000 telegram-forwarder-bot
```
#### Manual Deployment
- Clone this repository
```sh
git clone
cd
```
- Install dependencies
```sh
bun install
```
- Build the project
```sh
bun run build
```
- Set environment variables
- Start the bot
```sh
bun start
```
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
This project is licensed under the GPL-3.0-or-later - see the [LICENSE](LICENSE) file for details