This Reddit Comment Bot is a python-based auto-responder.
- Pick a subreddit to scan
- Designate a specific comment to search for
- Set your bot's reply
# Install dependencies
pip install -r requirements.txt
# Setup the sqlite db
python setup.py
- Navigate to the Apps page
- Click create an app
- name: Set a name for your app
- type: Script
- description: Optional
- about url: Optional
- redirect uri: http://localhost:8080
- Note the outputted client id and secret
cp .env.example .env
- BOT_NAME: your Reddit username
- PASSWORD: your Reddit password
- CLIENT_ID: the outputted client id
- CLIENT_SECRET: the outputted secret
Set the subreddit to search (default = "r/test"):
r.subreddit('test')
Comment search criteria (default = "sample user comment"):
if "sample user comment"
Bot's comment reply (default = "Hey, I like your comment!"):
comment.reply("Hey, I like your comment!")
Navigate into the bot directory. Run your bot:
$ python reddit_bot.py
It's possible to containerise the script.
To build it:
docker build -t reddit_bot -f .docker/reddit_bot/Dockerfile .
Then run with:
docker run -e SUBREDDIT=test -e SLEEP=0 -e SUBMISSION_PROBABILITY=0.25 -e COMMENT_PROBABILITY=0.1 -e REPLY_AGE=4 -e ENV=test -e MODE=once -e BOT_NAME=xxx -e PASSWORD=xxx -e CLIENT_ID=xxx -e CLIENT_SECRET=xxx reddit_bot
For a rundown of the phrases and their sources, see phrases.md. Yes, Elon Musk has said everything this dumb bot repeats.
- u/citycentre95 for convincing me to do this and a few ideas.
- u/Which_way_witcher for a few more ideas.
- u/RespondNo4954 for starting a petition to unban the bot, and succeeding!
- u/throwaway3292923 for joining the discussion with a suggestion, "It's a hit piece".
- u/Hot-Bint for a bunch of ideas.
- Everyone on r/EnoughMuskSpam who had something nice to say about the bot. Very few of the things I make gets feedback like this.