mirror of
https://github.com/tiennm99/forward-telegram-message.git
synced 2026-10-12 16:15:16 +00:00
16cf1c7b758a0dedd64e9de37f7e0c2b892d8d03
forward-telegram-message
A Telegram message forwarder that forwards messages from a source chat to a target chat.
This project is implemented in Go using the gotd/td Telegram client library.
Features
- Forward messages from one Telegram chat to another
- Automatic reconnection on disconnect
- Proper error handling and logging
- Environment variable configuration
Requirements
- Go 1.24 or higher
- Telegram API credentials (visit https://my.telegram.org/ to get them)
Installation
- Clone the repository:
git clone https://github.com/tiennm99/forward-telegram-message.git
cd forward-telegram-message
- Install dependencies:
go mod tidy
Configuration
Create a .env file in the project root with the following content:
TG_PHONE=+1234567890
API_ID=123456789
API_HASH=0123456789abcdef0123456789abcdef
SOURCE_GROUP_ID=-123456789
TARGET_GROUP_ID=-123456789
Replace the values with your Telegram credentials and chat IDs.
Usage
- Install dependencies:
go mod tidy
- Run the application:
go run .
The application will connect to Telegram and start forwarding messages from the source chat to the target chat.
The Original Python Version
The original Python version of this project can be found at the feature/python branch.
Description
Mirror Telegram messages between two chats using Telethon — runs as a user-account, not a bot.
Readme
Apache-2.0
327 KiB
0 Stars
1 Watchers
0 Forks
Languages
Python
100%