Introduction and first steps to deploying a Telegram Endpoint with Cognigy.AI

This tutorial explains how to connect a virtual agent to Telegram.

Within the Cognigy.AI platform, one is able to connect Cognigy resources to the Telegram channel by using the Webhook Endpoint integration.

Telegram Profiles

Since every Telegram user has their own profile, the included information can be used in a virtual agent in order to provide a more personalized user experience.

Get Profile Data

The Telegram Profile Data exposes a contact's profile information, such as their name and mobile phone number, in your Flow. You can access this profile information in input.data and input.data.request in your Flow. The table below shows some common information you will find in this object.

Key Description
message.message_id The internal ID of the sent message.
message.from The information object of the Telegram user.
message.from.id The Telegram user's ID.
message.from.is_bot Whether the Telegram sender is a bot or not.
message.from.first_name The configured first name of the Telegram user.
message.from.language_code The configured language of the Telegram user, which could be used in order to switch the locale, for example.
message.chat The general chat information, which is almost similar to the from object.
message.chat.id The ID of the chat, which is the same as the message.from.id in private chats.
message.chat.first_name The same as message.from.first_name in private chats.
message.chat.type The type of chat. Typically, this is set to "private".
message.date The timestamp of the sent message.
message.text

The Telegram user's text message. It is automatically used as input.text in the Endpoint.


Update Contact Profiles

In order to store the profile information permanently, one could use the UpdateProfile node to do so. However, the Telegram user needs to be asked for acceptance before one is allowed to store personal information. 


Comments

0 comments

Please sign in to leave a comment.

Was this article helpful?
0 out of 0 found this helpful