A Slack bot with several services. Once the application is running you can invite your bot to any Workspace and start taking advantage of the services it provides. More on the services available can be found once the app is running.
- Start by creating a new Slack App for your workspace
- In the settings page you'll find the Bot Users tab where you can setup a new Bot User in order to enable our newly created app to communicate on Slack.
- Navigate to OAuth & Permissions tab in the setting page and note down the Bot User OAuth Access Token as we are going to need that later.
-
Create a new virtual environment running the following commands from the root of your project directory:
virtualenv env -
Activate your new virtual environment:
source env/bin/activate -
Install all the Python packages needed for this application:
pip install -r requirements.txt
-
Create SQLite database which is going to be used by the app services:
python db/create_db.pyThis will create a new database file called services_db.db
-
Rename .env.example to .env and edit the values inside it:
- SERVICES_BOT_ACCESS_TOKEN value should be the Bot User OAuth Access Token you noted when you created the Slack app.
- DB_FILE value is the absolute path to services_db.db which have been created in the previous step.
- ROOT_PATH value is the absolute path to the root folder "python-services-with-slack"
Now all what is left is to run the application:
python app.py
You should see the Bot status as online now. The Bot will listen to all channels it is invited to.
Start by sending the message Help to get a list of available services.
All done 🎉 now you can take advantage of all the services this Slack Bot provides.