2025-11-29 13:52:52 +07:00
2025-11-29 13:52:52 +07:00
2025-11-29 13:52:52 +07:00
2024-06-22 17:53:37 +07:00
2025-11-29 13:52:52 +07:00
2024-07-03 21:56:10 +07:00
2025-11-29 13:52:52 +07:00
2024-06-22 18:22:19 +07:00

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

Installation

  1. Clone the repository:
git clone https://github.com/tiennm99/forward-telegram-message.git
cd forward-telegram-message
  1. 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

  1. Install dependencies:
go mod tidy
  1. 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.

S
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%