To setup Slack as a channel, you must associate the bot with a Slack app. Adding the Slack channel to your Kore.ai bot allows end-users of your bot to interact with your bot using their Slack accounts.
- Create a Slack App – Create and configure a new app in Slack, and then copy app data from Kore.ai bot builder into the Slack app configuration for the bot name and Redirect URL.
- Copy Authorization Details – Copy app authorization details from Slack to the bot builder Slack channel Get App Details tab.
- Create a Bot User in Slack – In Slack, add a bot username to identify your bot.
- Enable the Channel – In Bot Builder, save the channel settings.
Add Slack Channel to a Bot
To complete this procedure, you must already have a Slack account and be a member of a Slack team.
- Under the Bots section of the bot builder, click the bot to which you want to add the Slack channel.
- On the Channels tab, click the Slack icon. The Slack Channel page is displayed.
- In a new browser tab, Login to the Slack developer portal and go to the Apps section https://api.slack.com/apps. If this is your first app, click Create an App and if you already have some apps, then click Create New App.
- On the Create App window, enter App Name and select a team from Development Slack Team drop-down list. Use your bot name as the App Name.
- After you enter the required information, click Create App. Slack will now create a new app and you are redirected to Basic Information section of the new app.
- Go to OAuth & Permissions tab and click Add a new Redirect URL. Copy the Redirect URL provided in the Configurations tab of Slack channel page and enter in the Redirect URLs field.
- Click Add > Save URLs.
- Proceed to the Bot Token Scopes section under the ‘Scopes’ section.
- Add ‘incoming-webhook‘ and ‘chat:write‘ scopes.
- If you would like your users to send attachments to your bot, then select the ‘files:write’ scope
- If you would like to send Proactive Notifications to your users on Slack, then select the users:read, users:read.email, team:read scopes
- In the OAuth & Permissions tab, navigate to the OAuth Tokens & Redirect URLs section, and select the Install to Workspace option. Choose the required Workspace and complete the process.
Optionally, if you would like to send Proactive Notifications to your users on Slack, copy the ‘Bot User OAuth Token’ from the ‘OAuth Tokens for Your Team’ section and provide it in the Configurations tab of this page.
- To enable Interactive Components, go to the b section and enable Interactivity. Copy the Webhook URL provided in the Configurations tab of this page and enter it in Request URL field.
- Click Save Changes.
- Go to the Event Subscriptions section and activate the Enable Events option.
- Copy the Webhook URL provided in the Configurations tab of Slack Channel page and enter it in the Request URL field.
- In the Subscribe to Bot Events section, add app_mention, message_channels, and message_im events.
- In the Subscribe to Workspace Events section, add message_im event.
- Click Save Changes.
- Navigate to the App Home section and under Show tabs. Enable the Messages Tab and also enable the Allow users to send Slash commands and messages from the messages tab. This is required to allow your users to directly interact with the app from the Messages tab.
- Go to the Basic Information section and scroll down to App Credentials section. Capture the values of Client ID, Client Secret, and Verification Token fields and provide them in the Configurations tab of the Slack Channel page.
- If you want to enable the public distribution of your app on Slack, you must proceed with the following steps. Go to the Manage Distribution section and click on Remove Hard Coded Information.
- Select the checkbox I’ve reviewed and removed any hard-coded information and click Activate Public Distribution.
- Go to the Configurations tab to review and complete the channel setup.
The Successfully added Slack channel message is displayed at the top of the Bot Builder Homepage. In Slack, it is optional to submit your app to the Slack App Directory.
Edit Slack Channel
To edit the Slack channel, follow the below steps:
- Hover over the channel and click to modify. You can make necessary updates to your channel configurations and save them.
- You can also disable or delete the channel information by clicking the Settings icon.
- Select one of the following commands to modify the channel:
- Disable/Enable – Click Disable to temporarily disable the use of the Slack channel for your bot. To enable the use of the Slack, click Enable.
- Delete – Click Delete, and then click OK in the Delete Confirmation dialog to permanently delete the bot channel configuration.
Warning: This operation is permanent, and cannot be undone.