Botpress Cloud: Messaging Channels

Slack

Messaging channels

Requirements

Create a Slack App

You will need a Slack App to connect your bot to Slack

  1. Go to your apps page
  2. Click Create new app, select From scratch then give it a name. Remember your App's name, you'll need it in a few minutes

Channel Configuration

Signing Secret

The signing secret is used to verify webhook requests

  1. In the left sidebar, click on Settings > Basic Information
  2. Scroll down to App Credentials section. Next to Signing Secret, click Show to reveal the signing secret.
  3. In Botpress, copy the signing secret from the previous step in the Signing Secret box.

Bot Token

The bot token is used to authenticate requests made to the Slack API

  1. In the left sidebar, click on Features > OAuth & Permissions
  2. Under the Scope > Bot Token Scopes section, click Add an OAuth Scope. Select the chat:write option from the list.
  3. Near the top of the page, click on Install to Workspace in the OAuth Tokens for Your Workspace section
  4. In the next screen, your app will request access to your Slack workspace. Click Allow.
  5. In the OAuth & Permissions > OAuth Tokens for Your Workspace section, copy the Bot User OAuth Token.
  6. In Botpress, copy the Bot User OAuth Token from the previous step in the Bot Token box.

Save Configuration

Channel configuration is complete, you can now click Save. It is important you save your configuration before configuring the webhooks, otherwise Slack will be unable to validate the webhook url

Webhook Configuration

Events Webhook

Slack sends regular events such as messages to the event webhook

  1. In the left sidebar, click on Features > Event Subscriptions
  2. Turn on events by click the On/Off button
  3. Copy paste the webhook url provided in the channel configuration UI to the Request URL field
  4. Under Subscribe to bot event, add message.im and message.channels
  5. Click the Save Changes button. Make sure your Slack channel configuration is saved before doing this step, otherwise webhook validation will fail
  6. A yellow banner will be displayed at the top of the screen. Click the reinstall your app link
  7. In the next screen, your app will request access to your Slack workspace. Click Allow.

Interactivity Webhook

Slack sends "interactive" events such as reactions to message to the interactivity webhook

  1. In the left sidebar, click on Features > Interactivity & Shortcuts
  2. Turn on interactivity by click the On/Off button
  3. Copy paste the webhook url provided in the channel configuration UI to the Request URL field
  4. Click the Save Changes button

Install App

Add App to Workspace

Your Slack app needs to be added to your workspace to allow Slack users to communicate with it

  1. In the left sidebar, click on Features > App Home
  2. Scroll down and in the Show Tabs > Messages Tab section, tick Allow users to send Slash commands and messages from the messages tab
  3. 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 now chat with your Slack App