Integrating your Brainybear AI chatbot with Slack can revolutionize workspace interactions by providing immediate and automated responses to team questions. This integration not only enhances productivity but also saves hours otherwise spent answering frequently asked questions or addressing knowledge-based inquiries.
A Slack App to connect your bot to Slack.
A Brainybear Business plan.
If you don't have a Slack app already, follow the steps below to create one:
Done! You have created a Slack app.
Bot Token
Scroll down to the Scope > Bot Token Scopes section, click Add an OAuth Scope. Select both chat:write and chat:write.customize options from the list.
Scroll up and click the Install to Workspace button in the OAuth Tokens for Your Workspace section.
In the OAuth & Permissions > OAuth Tokens for Your Workspace section, copy the Bot User OAuth Token.
Copy the token and paste it in the Bot Token input in Brainybear and click Complete Integration.
Events Webhook
Slack sends regular events such as messages to the event webhook
Copy paste the webhook url provided in the Brainybear integration UI to the Request URL field
Under Subscribe to bot event, add message.im and message.channels.
Please note that the 'message.channels' event triggers every time a user posts a message in the channel, which can be annoying in some cases. Consider removing this event and replacing it with the 'app_mention' event, so that the chatbot only replies when someone tags it, for example, @brainybear.
Your Slack app needs to be added to your workspace to allow Slack users to communicate with it:
Scroll down and in the Show Tabs > Messages Tab section, tick Allow users to send Slash commands and messages from the messages tab
In Slack, under the Apps section of the sidebar, click the + Add apps button. In the search bar, type the name of your Slack app. Click on your Slack app in the search results. You can then begin chatting with your Slack app directly.
To add the chatbot to your channel, click the dropdown button under the App name. Click on the + Add this app to channel button. Please note that the chatbot will respond to every message in this channel unless you remove the 'channel.message' event as mentioned above.