Ernestina is a rubber duck who would like to help you with your code. She currently lives and works at correctiv.org Her slackbot code is based on Ellie and Eliza.
Ernestina is a modification of Ellie. Ellie is a Slack Python-based real-time messaging bot wrapped around Daniel Connelly's Python implementation of Peter Norvig's Paradigms of AI Programming Eliza .. with updated diction.
If you'd like to dive into Ernestina's innerworkings, ernestina.py is your file. If you're new to setting up and running and building slackbots, this beginner's guide is recommended reading.
- Download Ernestina
git clone [email protected]:lisaq/ernestina-slack.git
cd ernestina-slack
- Install dependencies
pip install -r requirements.txt
- Configuration From the Slack console, you'll get to choose your bot's name and icon.
There's a configuration file called config.conf which is pretty basic; if you're adding plugins or such which need to be loaded, this is a good place to put them. It's recommended that you make a second file called local.conf (which is ignored by github) to set envirnoment variables such as your Slack token. You'll want to set these:
DEBUG: True
LOGFILE: "logfile.log"
SLACK_TOKEN: "xoxb-11111111111-222222222222222"
SLACK_BOT_ID: "UXXXXXXXX"
Explained:
DEBUG
: turn this on locally to get more information on errors
LOGFILE
: all the logging
statements will output here
SLACK_TOKEN
: this is the API Token in your bot's settings in the Slack admin interface
SLACK_BOT_ID
: your bot's user id can be found in the url when you edit the settings in the admin interface
note: remove the "B" at the beginning of the id when using it in the configs
- Run her!
python rtmbot.py
You've got to keep her running so long as you'd like her to keep chattering. We deployed her to Heroku; see Heroku's Python docs. Stuff like the runtime and Procfile are already set up for Heroku.
- If you want to build the Docker image on your own
docker build -t napramirez/ellie-slack:1.0 .
- Or if you already have the Slack token and just want to run the Docker image
docker run -d --env SLACK_TOKEN="xoxb-11111111111-222222222222222" napramirez/ellie-slack:1.0