Skip to content

Configurable telegram bot for fetching reddit hot/top news

License

Notifications You must be signed in to change notification settings

fversaci/reddit_fetcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reddit-Fetcher Telegram Bot

Overview

This bot, written in Rust, shows the hot/top entries of selected subreddits. The subreddits can be chosen from a user-customizable list, or typed-in directly (whitespaces are ignored). Per-user preferences are saved in a simple sqlite3 DB.

Requirements

In case they are installed, Reddit-Fetcher tries and download images and videos using, respectively, wget and yt-dlp (thus increasing the use of bandwidth of the bot...)

Running the bot

Assuming you have cargo correctly setup, just run:

TELOXIDE_TOKEN=123_YOUR_TELEGRAM_BOT_TOKEN_567 \
DATABASE_URL="sqlite://conf/users.db3" \
cargo run --release

Click image below to show an example video:

Configuration

Filtering the user access

The configuration file conf/defaults.json contains an id_whitelist field, which can be filled with a list of allowed Telegram user_ids:

  "id_whitelist": [
    123456789,
    987654321
  ]

If the list is left empty, filtering is not performed (i.e., all users will be able to use the bot).

Choosing the default subreddits

In the same configuration file the field cat_subreddits describes the default categories and subreddits.

Per-user configuration

Users can download a JSON description of their currently active subreddits via the /getsubs command, upload a customized version via /sendsubs and delete any existing customization with /delsubs.

Choosing which images and videos to download automatically

In the configuration file there are also lists of defaults prefixes (e.g., https://i.redd.it) and suffixes (e.g., .jpg) for URLs to be considered images or videos, to allow their automatic download as soon as a match occurs. If needed, you can customize this list to include other websites or file extensions.

Author

Reddit-Fetcher Telegram Bot is developed by

License

Reddit-Fetcher Telegram Bot is licensed under the GPLv3 License. See LICENSE for further details.

Releases

No releases published

Packages

No packages published

Languages