A simple Python-powered Slack bot, using the Cat Facts API.
- Set up a new Bot User, as instructed in the tutorial below (don't forget to invite your new bot user to one or more slack channels).
- configure your bot token environment variable:
export SLACK_BOT_TOKEN='your slack token pasted here'
- clone this repo and
cd
into the new directory - create a new virtualenv for the project, and activate it
- run
pip install requirements.txt
to install the slackclient library - find your bot user ID and target user ID
- option 1: visit the API page below and use a Ctrl-F search to find your bot and target user IDs by name
- option 2: use the included python script, passing in the user name as an argument
- configure your other environment variables:
export CATFACT_BOT_TRIGGER_STRING="cat"
export CATFACT_BOT_TARGET_USER_ID="U1234Q03D:
export CATFACT_BOT_ID="U1234Q03D"
- start the bot (you should see the bot user become 'active' in slack)
python starterbot.py