Standard Reddit chatbot which replies to comments containing a keyword in your favourite subreddit. Simply modify the parameters mentioned in the setup to create your own custom reddit chatbot to add some life to your subreddit!
-
Clone this repo to your local machine.
-
Add the following values to your environment
praw_client_id=<client_id> praw_client_secret=<client_secret> praw_username=<reddit_username> praw_password=<reddit_password>
You can obtain a client id and secret by registering a script app at https://www.reddit.com/prefs/apps/.
-
Add your list of possible replies to
quotes.txt
. Take care to save each new reply in a new line. The bot will choose a random reply from the ones supplied. -
Add the subreddit, the keyword to trigger your bot and the user agent to
reddit_bot/constants.py
. Make sure to read about reddit etiquette while choosing these values. -
Install requirements with
pip install -r requirements.txt
-
Start your bot with
python run.py
The bot keeps reading from reddit until terminated.
-
Whenever a comment that matches the keyword is posted, the bot replies with a random quote chosen from
quotes.txt
. The profile of the user whose username and password are supplied(and for whom the reddit app was created) is used for replying.