The Lunchbot can be used to register for Lunches, ask for reservation status and more.
It includes a docker compose file using Flask-Restless + Flask-Sqlalchemy + Postgres. This project includes a HTTP API for CRUD operations. The database is described in flask/app.py
You can browse the api by calling http://127.0.0.1:5000/api/lunch in your browser.
The actual chatbot will be created during the Hackathon "Create your own chatbot! by plista" taking place in June.
To install Docker see instructions at https://docs.docker.com/engine/installation/. I used the simple command curl -sSL https://get.docker.com/ | sh
To install Docker Compose see instructions at https://docs.docker.com/compose/install/
Then get the code
git clone --recursive https://github.com/torbenbrodt/lunchbotYour bot connects via a simple slack-token to the corresponding slack-team. For sake of simplicity the workshop organizers can provide you with token for the hackathon slack-team http://lunchbot-hackathon.slack.com.
Of course you can also use your personal slack channel. In this case get a Bot token from: http://my.slack.com/services/new/bot Afterwards update your docker compose environment
echo "token=xxxx-xxxxxxxxx-xxxx" > .envStart flask and postgres via.
docker-compose up flask some-postgresYour code lives in chatbot/app/server.js. Here the actual work happens. To run it please execute
docker-compose up chatbotSometimes docker-composer is just to generic and you want to execute commands on your own.
docker run -it --rm --name my-running-app -v "$PWD/chatbot/app":/usr/src/app/app -w /usr/src/app --env-file .env lunchbot_chatbot /bin/bashThe following examples show you how to work with it using your command line.
curl -H "Content-Type: application/json" -X POST -d '{
"chef": "Bob",
"date": "2017-06-30 12:30:00",
"is_meat": "True",
"is_vegan": "False",
"is_vegetarian": "False",
"text": "Today its Salami",
"title": "Lunch with Bob"
}' http://127.0.0.1:5000/api/lunchcurl -H "Content-Type: application/json" -X POST -d '{
"username": "peter",
"lunch_id": 1
}' http://127.0.0.1:5000/api/registration