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.
Note: The steps have been modified in v7.1 of the platform in sync with changes to the channel requirements.
- Under the Bots section of the bot builder, click the bot you want to add the Slack channel to.
- 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.
- To create a Bot user, go to the Bot Users section and click Add a Bot User.
- Provide values for Display name, Default username, and then Save changes. Try to use your bot name as Display name and Default username. A bot user is now added to your Slack app.
- To enable Interactive Components, go to the Interactive Messages section and click Enable Interactive Components. 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.
- 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 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.
- After you submit your app for public distribution on Slack, you can also optionally submit your app to the Slack directory. Click Submit to App Directory option and you are redirected to separate form. Fill out the form and submit for approval.
- 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.