Skip to content

Commit e7df86b

Browse files
committed
Add a diagram + more images & a mention for .env
1 parent dddc251 commit e7df86b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
This is the repository with materials for the [Building a practical Slack bot with Python & FastAPI
44
](https://ep2021.europython.eu/talks/9xzPSHe-building-a-practical-slack-bot-with-python-fastapi-training/) training.
55

6+
## Overview
7+
8+
![Slack Chat Bot@2x](https://user-images.githubusercontent.com/387867/126901049-4a965bad-41b4-4168-8ba7-05cc4322dee3.png)
9+
610
## Step 0 - OS setup
711

812
This training is using the following OS tools:
@@ -245,6 +249,20 @@ Extracted documentation links to help you navigate to the proper stuff to look a
245249
1. [Retrieving individual messages](https://api.slack.com/messaging/retrieving#individual_messages)
246250

247251

252+
### Hints
253+
254+
Making a call to Slack requires obtaining `Bot User OAuth Token` from the settings page:
255+
256+
![europython](https://user-images.githubusercontent.com/387867/126901159-808b77db-04f2-4b3d-85d0-e6a851155959.png)
257+
258+
Since this is a secret, in order to manage secrets for our app, we recommend using `.env` file and <https://github.com/theskumar/python-dotenv> for parsing it:
259+
260+
```python
261+
from dotenv import dotenv_values
262+
263+
config = dotenv_values(".env") # config = {"USER": "foo", "EMAIL": "[email protected]"}
264+
```
265+
248266
## Step 8 - Validate Slack requests
249267

250268
Everything is great, but our API is public, meaning anyone can call it and start sending messages to our Slack.

0 commit comments

Comments
 (0)