TGF monitors Telegram channels and automatically forwards new messages to a destination channel. Lightweight, single-binary, no bloat.
- Multi-source – Forward from many channels into one
- Reply chains – Forwards replies together with their parent messages
- Media albums – Groups album messages and forwards them as a batch
- Deduplication – Tracks forwarded messages so nothing is sent twice
- Configurable delay – Set a delay between forwards to avoid rate limits
- History window – Only forward messages from the last N hours
- Dashboard – Live terminal UI showing status (disable with
-d) - Single binary – No runtime deps beyond TDLib
- TDLib (
libtdjson) - GCC or Clang
- A Telegram API ID and hash
Arch Linux:
yay -S telegram-tdlibDebian/Ubuntu:
apt install libtdjson-devmacOS (Homebrew):
brew install tdlibBuild from source: See tdlib/td
git clone https://github.com/Hadi493/tgf-c.git
cd tgf-c
cp config.json.example config.json
# edit config.json with your API credentials and channels
gcc -o nob nob.c
./nob
./tgfEdit config.json:
{
"api_id": YOUR_API_ID,
"api_hash": "YOUR_API_HASH",
"source_channels": ["@channel1", "@channel2"],
"dest_channel": "@me",
"history_file": "history.txt",
"forward_delay_sec": 10,
"history_window_hours": 24
}| Field | Description |
|---|---|
api_id / api_hash |
From my.telegram.org |
source_channels |
Channels to monitor |
dest_channel |
Where to forward (@me for Saved Messages) |
forward_delay_sec |
Seconds between forwards (default: 1) |
history_window_hours |
Only forward messages newer than this (default: 24, 0 = all) |
./tgf # normal mode – shows dashboard
./tgf -d # debug mode – verbose logs, no dashboardOn first run you'll be prompted for your phone number, verification code, and 2FA password (if enabled). Session is cached in tdlib_db/.
No strict guidelines – just follow the existing code style and keep it simple.