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
.env
file 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
Scopes
division, there are two categories of scopes:Bot Token Scopes
andUser Token Scopes
. Append the following scopes underBot Token Scopes
:app_mentions:read
chat:write
channels:history
groups:history
im:history
mpim:history
- Ascend to the
OAuth Tokens for Your Workspace
and hit theInstall App To Workspace
button. This operation will produce theSLACK_BOT_TOKEN
. - On the left-hand side menu, click on
Socket Mode
and activate it. You'll be asked toGenerate an app-level token to enable Socket Mode
. Generate a token labeledSLACK_APP_TOKEN
and include theconnections:write
scope. - In the
Socket Mode
page'sFeatures affected
section, hitEvent Subscriptions
and switchEnable Events
to theOn
state. Append the app_mention event, coupled with theapp_mentions:read
scope in theSubscribe to bot events
subsection below the toggle.