github.com/sharovik/devbot@v1.0.1-0.20240308094637-4a0387c40516/documentation/slack.md (about) 1 # Slack configuration 2 Before the installation I would recommend prepare the slack application for your account. 3 There are 2 ways of doing it - Legacy and New(Recommended) 4 5 ## New 6 With the new way you will be able to create an application using the [slack-app_manifest.yml](../slack-app-manifest.yml) configuration, which is provided in root directory. 7 Below you can see more detailed instruction: 8 9 1. First go to [applications page](https://api.slack.com/apps?new_app=1) 10  11 2. I would recommend you to create the application from manifest, because it is simpler. If you decide to create the application from scratch, please make sure you add the scopes defined in [slack-app_manifest.yml](../slack-app-manifest.yml) 12 3. After application created, please generate the application token with the scope like in image below. This token you need for `SLACK_OAUTH_TOKEN` variable 13  14 4. Install your application to the workspace 15 5. After installation, please go to `OAuth & Permissions` page and take the token from `Bot User OAuth Token` and add it to `SLACK_WEB_API_OAUTH_TOKEN` variable. 16 6. Switch `SLACK_LEGACY_BOT` to `false` for enabling the new way of websocket connection. 17 7. Enable send messages from `Direct messages Tab` 18  19 As the result you should set the next variables: 20 ``` 21 SLACK_OAUTH_TOKEN= 22 SLACK_WEB_API_OAUTH_TOKEN= 23 SLACK_LEGACY_BOT=false 24 ``` 25 26 ## Legacy 27 This is the old way of the application configuration, where you will create a legacy application and use only one token for all actions of our bot. 28 Below you can see the instruction: 29 30 1. Go to [applications page](https://api.slack.com/apps?new_classic_app=1) of slack and create new application there 31 2. Once new application created you will be redirected to the application `Basic Information` page, where you have to click in the `Building Apps for Slack` section to the `Add features and functionality` block. There you need to click to the `Bots` button. 32 3. Add a Bot user. Specify the `Display name`, `Default username` and his `online status` 33 4. After you created a bot user, please go back to the `Basic Information` page and install your app to your workspace. You can find the `Install your app to your workspace` button in the `Building Apps for Slack` section. 34 5. Now you need to get the OAuth tokens for our bot user. For that please go to `OAuth & Permissions`, there you will find the `Bot User OAuth Access Token` which appears only after application installation to your slack account. This token you will need to specify in .env configuration file of your bot 35 6. Set the value from `Bot User OAuth Access Token` into *SLACK_OAUTH_TOKEN* variable in the `.env` file 36 7. Switch `SLACK_LEGACY_BOT` to `true` for enabling the legacy way of websocket connection 37 As the result you should set the next variables: 38 ``` 39 SLACK_OAUTH_TOKEN= 40 SLACK_LEGACY_BOT=true 41 ``` 42