-
Notifications
You must be signed in to change notification settings - Fork 7
Slack setup
Miguel Ángel Sánchez Palafox edited this page Sep 23, 2021
·
6 revisions
This setup is required only the first time the Slack bot is created. Ideally, you will use a secondary Slack Workspace to avoid event collisions (multiple bots handling same event), functionality overlap, channel & notification spam, etc.
Please read the full page and start the local app before starting with this guide. Also, if you have not done so, read and follow the Quick start guide on the README.md file.
- Select Create New App button, fill in all the required fields, and click on Create App.
- Go to OAuth & Permissions, scroll down, and add the following Bot Token Scopes:
- channels:history
- channels:read
- chat:write
- reactions:read
- users.profile:read
- users:read
- users:read.email
- Once these scopes are in place, scroll up and click on Install App to Workspace.
- After the app is correctly installed, copy your bot token, save it to
.env
, and restart the server.
- If running on the foreground, kill
docker-compose
with Ctrl+C and start it again. - If running on the background, run
docker-compose restart
.
- On a new browser tab/window, open the ngrok inspector and copy the public https URL.
don't be confused you don't need to install on your machine ngrok, the ngrok is running through docker
- Go to Event Subscriptions and turn it on. Paste the ngrok URL into the URL field, it must get the green verified checkmark to work.
- Click on Subscribe to bot events and subscribe to the following events:
- message.channels
- reaction_added
- reaction_removed
-
Click on Save Changes.
-
In your Slack Workspace, invite the bot to a channel
/invite @botname
and test by sending a message like:test ++
Done!
- ngrok URLs expire after 8 hours, that means you will need to restart your local development server after that time.
- Every time ngrok starts will assign a new URL, therefore you will need to update the URL used in "Event Subscriptions".