Skip to content

solarin/RedditToTelegram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– RedditToTelegram

A personal Telegram bot that monitors your favorite subreddits and sends you instant notifications when new posts appear. If the post has a video, the bot can download and send it directly to your Telegram chat.


✨ Features

  • πŸ“‘ Monitor multiple subreddits β€” add/remove subreddits at any time via Telegram commands
  • πŸ”” Instant notifications β€” get notified when new posts match your criteria
  • 🎬 Video download β€” tap a button to download and receive the video directly in Telegram (powered by yt-dlp)
  • βš™οΈ Smart filters:
    • Minimum upvotes / comments threshold
    • Filter by post type (videos only, images only)
    • Filter by flair or keyword in title
    • NSFW toggle
    • Sort by: new, hot, or rising
  • πŸ“Š Top posts β€” fetch the top posts of any subreddit by time range
  • πŸ“° Digest β€” get a quick summary of hot posts across all your subreddits
  • ⏸️ Pause/Resume monitoring without stopping the bot
  • ⏱️ Configurable interval β€” set how often the bot checks for new content

πŸš€ Setup

1. Clone the repo

git clone https://github.com/yourusername/RedditToTelegram.git
cd RedditToTelegram

2. Install dependencies

pip install -r requirements.txt

Note: yt-dlp requires ffmpeg to merge video and audio. Install it with: sudo apt install ffmpeg (Linux) or brew install ffmpeg (macOS)

3. Create your .env file

cp .env.example .env

Fill in your credentials:

Variable How to get it
TELEGRAM_TOKEN Create a bot via @BotFather
ALLOWED_USER_ID Get your ID from @userinfobot
REDDIT_CLIENT_ID reddit.com/prefs/apps β†’ create a "script" app
REDDIT_CLIENT_SECRET Same page as above
REDDIT_USER_AGENT Any string, e.g. RedditToTelegram/1.0 by u/yourusername

4. Run the bot

python src/bot.py

πŸ“‹ Commands

Subreddits

Command Description
/add <subreddit> Start monitoring a subreddit
/remove <subreddit> Stop monitoring a subreddit
/list List all monitored subreddits

Filters

Command Description
/filters Show current filter settings
/setfilter <key> <value> Set a filter (see keys below)
/resetfilter Reset all filters to defaults

Filter keys:

Key Type Default Description
min_score int 10 Minimum upvotes
min_comments int 0 Minimum comments
only_videos bool false Only notify for video posts
only_images bool false Only notify for image posts
nsfw bool false Include NSFW posts
flair string null Filter by flair text
keyword string null Filter by title keyword
sort string new Sort: new, hot, rising

Monitor Control

Command Description
/status Show bot status and current settings
/pause Pause monitoring
/resume Resume monitoring
/interval <minutes> Set check interval (default: 15 min)

Content

Command Description
/top <subreddit> [day|week|month] Top posts from a subreddit
/digest Hot posts summary from all subreddits

πŸ”’ Security

The bot only responds to the ALLOWED_USER_ID specified in .env. All other users are ignored.


πŸ“ Project Structure

RedditToTelegram/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ bot.py          # Entry point, wires everything together
β”‚   β”œβ”€β”€ config.py       # Loads settings from .env
β”‚   β”œβ”€β”€ handlers.py     # Telegram command handlers
β”‚   β”œβ”€β”€ monitor.py      # Background Reddit polling loop
β”‚   └── storage.py      # JSON state persistence
β”œβ”€β”€ data/               # Created at runtime (gitignored)
β”‚   β”œβ”€β”€ state.json      # Subreddits, filters, seen posts
β”‚   └── downloads/      # Temporary video downloads
β”œβ”€β”€ .env.example
β”œβ”€β”€ requirements.txt
└── README.md

πŸ“ License

MIT β€” personal use project.

About

πŸ€– Personal Telegram bot that watches your favorite subreddits and notifies you of new posts. Supports video download and delivery via Telegram.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages