Skip to content

A basic Reddit bot that looks for simple compliments in user comments and replies to the user redirecting the compliment to them.

Notifications You must be signed in to change notification settings

brentcklein/r-compliments

Repository files navigation

r-compliments

A very simple reddit bot that looks for simple compliments in comments on new posts and replies directing those compliments back to the poster.

Setup

Note: Poetry, which is used to manage project dependencies, requires python 3.7+

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

Environment variables

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").

Running locally

To run the bot locally, simply call:

python app.bot

Use CTRL+C to stop the bot at any time.

Deploying to Heroku

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

About

A basic Reddit bot that looks for simple compliments in user comments and replies to the user redirecting the compliment to them.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages