GeniA Slack App Bot¶
Installation¶
For the Slack GPT Bot to function effectively, it's crucial to establish the correct permissions for your Slack bot. Please follow the forthcoming guidelines to set up the necessary permissions.
Note
When it comes to Choosing a protocol to connect to Slack, there are two primary options. In this instance, we utilize Socket Mode, enabling your app to leverage the Events API and the platform's interactive components without the need for a public HTTP Request URL. Instead of sending payloads to a public endpoint, Slack employs a WebSocket URL to communicate with your app.
- In the project's root directory, mv the .env.template into
.envfile and input your Slack keys - Create a new Slack App.
- Navigate to your Slack API Dashboard and select the app you've created for this bot.
- On the left-hand side menu, click on
OAuth & Permissions. - Within the
Scopesdivision, there are two categories of scopes:Bot Token ScopesandUser Token Scopes. Append the following scopes underBot Token Scopes:app_mentions:readchat:writechannels:historygroups:historyim:historympim:history - Ascend to the
OAuth Tokens for Your Workspaceand hit theInstall App To Workspacebutton. This operation will produce theSLACK_BOT_TOKEN. - On the left-hand side menu, click on
Socket Modeand activate it. You'll be asked toGenerate an app-level token to enable Socket Mode. Generate a token labeledSLACK_APP_TOKENand include theconnections:writescope. - In the
Socket Modepage'sFeatures affectedsection, hitEvent Subscriptionsand switchEnable Eventsto theOnstate. Append the app_mention event, coupled with theapp_mentions:readscope in theSubscribe to bot eventssubsection below the toggle.