Skip to content

Slack

Slack is where work flows. It’s where the people you need, the information you share, and the tools you use come together to get things done. In this section, we will learn to connect our bot with Telegram. You can use the bot you created in the Hello World tutorial to start integrating your bot with Telegram.

Create Slack Channel

First thing first, you need to sign in into your Slack Team to create a new app and get its token. After logged in, open this URL:.

  1. Click “Start here” then “Create a Slack app”.

Start here Create Slack Apps

  1. Fill “App Name”. Choose your “Development Slack Team” and click “Create App”.

App Name

  1. From “Basic Information” in App Credentials section you can see Verification Token, we will use it later to deploy our bot.

Verification Token

  1. Open “OAuth & Permissions” and in “Scopes” section you should fill the scope permission by adding below scopes.

Filling Scopes

  1. Open “Bot User” in Features from the sidebar menu. Fill the “Display name” and “Default username” of your bot. Don’t forget to set “Always Show My Bot as Online” to “On” and press “Add Bot User” button to finish.

Bot User

  1. Go back to “OAuth & Permissions” and select “Install App to Workspace” then click “Allow”.

Install App to Workspace request_access

  1. Still in the “Oauth & Permissions” you will get “OAuth Access Token” and “Bot User OAuth Access Token”. we will use “Bot User OAuth Access Token” to deploy our bot using Kata Platform.

Create Slack Channel in Kata Platform

First, login to Kata Platform and select the project that you want to integrate with Telegram. Then, go to the Environment page by selecting “Deploy” > “Environment”.

Platform 3

In the Environments screen, select your desired environment to create Slack channel.

Click “Create Channel”. You will now see the “Create Channel” screen. Insert the channel name, and select Slack as the channel type. Then, copy and paste the previously acquired bot token, and click “Create”.

Create Channel Select Slack Fill Token Create Token

Setup Webhook URL in Slack Bot

Once finished, you will see the newly-created channel in the list. You will also see a Webhook URL for your channel. This webhook URL will be added to the Slack bot. Copy the webhook URL by clicking “View Channel” and clicking the copy button next to the Webhook URL field.

Copy Webhook

Next, back to the browser, and go to “Event Subscriptions” tab then switch “Enable Events” to “on”.

Event Subcriptions Enable Events

You will see “Request URL” field. Then put the webhook URL that previously copied here.

Request URL

Expand the “Subscribe to bot events” then add selected User Event like in the below image.

Subscribe bot events

Now you can search for your bot in your slack Workspace.

Workspace Search

It works! You can now share your newly created chatbot with your friends.

It Works

Contributing to the Documentation

Is something missing/incorrect? Please let us know by contacting support@kata.ai. If you know how to fix it straight away, don’t hesitate to create a pull request on this documentation’s GitHub repository.