A very simple reddit bot that looks for simple compliments in comments on new posts and replies directing those compliments back to the poster.
Clone the repository:
git clone https://github.com/brentcklein/r-compliments.git
install poetry
cd r-compliments
pip install -r requirements.txt
install project dependencies
poetry install
The bot relies on five environment variables in order to connect to Reddit: praw_client_id
, praw_client_secret
,
praw_username
, praw_password
, and praw_user_agent
. praw_username
and praw_password
are the username and
password for the Reddit account you wish to use. Follow
these instructions (under "Create Reddit App") to
create a Reddit app in order to obtain a client_id
and client_secret
, and Reddit's guidelines for creating a
user-agent string (under "Rules").
To run the bot locally, simply call:
python app.bot
Use CTRL+C to stop the bot at any time.
The app is also set up to deploy to Heroku. Follow
Heroku's instructions to install the heroku cli,
create an heroku application, and
set the required environment variables.
(Instead of heroku ps:scale web=1
, call heroku ps:scale worker=1
to ensure that at least one instance of the bot is
running.)
You can confirm that the bot is running by calling heroku logs --tail