Browse Reddit using this Discord bot! It downloads video posts, leaves r/5050 images unspoiled and shows a comment section preview.
Open an issue/request a feature
Click here to invite
- 🔥
r/pics
: shows a hot post from the r/pics subreddit. - 🔍
r/pics minecraft
: searches for posts in the r/pics subreddit containing 'minecraft'. - 🆕
r/pics new
: shows a new post. You can also use top, best, rising and hot. - 🕐
r/pics week
: shows a top post from the last week. You can also use hour, day, week, month, year and all. - 🔁
r//
: repeat your previous input.
To enable NSFW reddit content (e.g. r/fiftyfifty), you MUST mark the Discord channel as NSFW.
You can also paste a Reddit url into the chat, the bot will transform it into a nice embedded message.
This bot is made with nodejs, ffmpeg, youtube-dl and redis.
- The bot listens for any incoming Discord message and checks if the message's content starts with the
r/
prefix. - Parses input:
r/pics new
=>var subreddit = "pics", mode = "new"
. - Looks in the redis cache if a post was already requested from this subreddit. If not, request from the reddit api and store it in the cache.
- Loop through the reddit response until a post matches the filter.
- Store the current subreddit post index in the redis cache. (so the bot knows where to start looking for the next post)
- If video, use youtube-dl and ffmpeg to download and convert the video to mp4. If the video is larger than 8MB, compress the video using ffmpeg.
- Send the post in an embedded Discord message.
Copyright 2020 Stijn Rogiest
Do not reupload this bot to any bot distribution website without permission. This repository only exists to create issues or pull requests.