Skip to content

Hadi493/tgf-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TGF

TGF - Telegram Feed

Open-source Telegram content forwarding bot written in C

version GPL-2.0 license

TGF monitors Telegram channels and automatically forwards new messages to a destination channel. Lightweight, single-binary, no bloat.

Features

  • 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

Requirements

Install TDLib

Arch Linux:

yay -S telegram-tdlib

Debian/Ubuntu:

apt install libtdjson-dev

macOS (Homebrew):

brew install tdlib

Build from source: See tdlib/td

Quick Start

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
./tgf

Configuration

Edit 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)

Usage

./tgf         # normal mode – shows dashboard
./tgf -d      # debug mode – verbose logs, no dashboard

On first run you'll be prompted for your phone number, verification code, and 2FA password (if enabled). Session is cached in tdlib_db/.

License

GNU GPLv2

Contributing

No strict guidelines – just follow the existing code style and keep it simple.

About

Open-source Telegram content forwarding bot written in C

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors