A telegram bot that gives you a feed of top posts from your favorite subreddits.
The killer feature: No need to visit Reddit, as all media is embedded thanks to yt-dlp and Telegram's excellent media support.
Intended to be self-hosted, as Reddit's API has rate-limiting and downloading
videos with yt-dlp
can be resource intensive. The simplest way to self-host is
to use the prebuilt docker image that includes necessary
dependencies.
sh
$ cargo install tgreddit
Depends on yt-dlp (and for good results, yt-dlp requires ffmpeg).
/sub <subreddit> [limit=<limit>] [time=<time>] [filter=<filter>]
Add a subscription to subreddit's top posts with optional options. Subscriptions are conversation specific, and may be added in channels where the bot is participating or in private chats with the bot.
If the options are not given, when checking for new posts, the program will default to configuration in config.toml, if any.
Example: /sub AnimalsBeingJerks limit=5 time=week filter=video
Explanation: Subscribe to top posts in r/AnimalsBeingJerks so that the top 5 posts of the weekly top list are considered. Whenever a new post appears among those top 5 posts, they will be posted in the conversation.
/unsub <subreddit>
Remove a subscription from the current conversation.
/listsubs
List all subreddit subscriptions for the current conversation.
/get <subreddit> [limit=<limit>] [time=<time>] [filter=<filter>]
Get the current top posts similarly to how subscribing to a subreddit would return new posts.
CONFIG_PATH
: Path to TOML configuration file. requiredExample config without comments: config.example.toml
```toml
db_path = "/path/to/data.db3"
authorized_users = [ 123123123 ]
telegrambottoken = "..."
checkintervalsecs = 600
skipinitialsend = true
linksbaseurl = "https://teddit.net"
default_limit = 1
day
.default_time = "day" ```
Perhaps the simplest way to determine a Telegram channel's ID is to open the channel in Telegram Web client and observing the numeric value in page URL.
There's a prebuilt Docker image with dependencies included at rainevi/tgreddit.
Of course, you may also build your own using from the Dockerfile.
Feel free to open an issue or start a new discussion.