File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 33This 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
812This 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
2452491 . [ 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": "foo@example.org"}
264+ ```
265+
248266## Step 8 - Validate Slack requests
249267
250268Everything is great, but our API is public, meaning anyone can call it and start sending messages to our Slack.
You can’t perform that action at this time.
0 commit comments