How to Integrate a Dialogflow bot with Telegram
Tags: dialogflow, chattbot, chatgpt, telegram
Published: 2023-03-23 10:22:22

Telegram has been growing in popularity ever since it was launched close to a decade ago. The app has nearly 540 million users, which is a staggering number. The app offers a powerful alternative to WhatsApp and Facebook Messenger and claims to be more secure than both of these platforms. Speed and security are Telegram’s USPs.

Without further ado, here are the steps to integrate Telegram with Kommunicate.

The integration presented in this blog post will teach you how to:

Create a New Bot for Telegram
Connect a Bot to Kommunicate
How to connect a chatbot to Kommunicate
Open Your Kommunicate Dashboard

Step 1: Click Integrations

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvx9c52tfejst1m8gfrn.png)
 

Step 2: Click the Telegram card setting link
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ikn6wrks5w4rcgg49no.png)

Step 3: Paste the API key into the Telegram integration card from the Kommunicate Dashboard and click the “Save and Integrate” button. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zdwfqf1kpz8f5lt35y73.png)

How to create a new bot for Telegram

Open Telegram messenger, sign in to your account or create a new one.

Step 1: In the search bar, search for @botfather

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n20coyymbf7084uihbol.png)

 Step 2: Click the Telegram card setting link

Note: official Telegram bots have a blue checkmark beside their name

Step 2: Select the BotFather channel and click /start.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n4epp98sc38iekalw9t0.png)

Click on the “Send” button.

Step 3: Select /newbot – create a new bot.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wxixtcr2lzwjjbyzmdxu.png)

Step 4: Add a bot name to call (Kommunicate_Telegrambot) and enter the bot name to display (Kommunicate321_Telegrambot)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pn45glkde0vwslroymlu.png)
Step 5: Copy the API key that is generated under “Use this token to access the HTTP API”

After creating the Telegram bot, follow the steps to trigger the Dialogflow chatbot.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13rhg9t6d23yr0br1tfw.png)

Step 1: Click on the link to open the chatbot you created on Telegram


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/159ig1p0nvbfhh1a31by.png)

Step 2: Click on START to initiate a chat, once you click on START, you will send a message to Kommunicate. Next, the Dialogflow chatbot will start answering with the Welcome message you trained on the Dialogflow side.

Make sure you have selected the Dialogflow chatbot on the RULES section of the Kommunicate dashboard. Check here to build and integrate the Dialogflow chatbot if you still need to create one.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4nhi7ua9grczmsu44zt.png)

This is how your Kommunicate dashboard will look after the integration is complete:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pw89f9bf7dhezycpxgoo.png)

You have now created your new bot for Telegram.