/triggerbot

Bot that replies canned answered based on trigger words

Primary LanguagePythonMIT LicenseMIT

Reddit Trigger Bot

Bot that will reply a canned answer upon being triggered by a keyword.

Requirements

  • praw
  • PyYAML

Details are found in requirements.txt.

To install

  1. Clone the repository
git clone git@github.com:normcyr/triggerbot.git
  1. Create and activage a Python 3 virtual environment
cd triggerbot
virtualenv -p python3 venv
source venv/bin/activate
  1. Install the triggerbot module

The requirements are included in the setup.py file.

pip install -e .
  1. Prepare the configuration files and log files

Create new log files:

mkdir -p triggerbot/log
touch triggerbot/log/info.log
touch triggerbot/log/errors.log

Create the configuration files from the example files:

mv triggerbot/config/config.yml.example triggerbot/config/config.yml
mv triggerbot/config/logging.yml.example triggerbot/config/logging.yml

Then edit both files to suit your needs using your favorite editor (eg nano):

nano triggerbot/config/config.yml
nano triggerbot/config/logging.yml
  1. Start the script
triggerbot

You may include LOGGING=DEBUG before the triggerbot command to enable debugging.

LOGGING=DEBUG triggerbot