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.
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
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.
|The internal ID of the sent message.
|The information object of the Telegram user.
|The Telegram user's ID.
|Whether the Telegram sender is a bot or not.
|The configured first name of the Telegram user.
|The configured language of the Telegram user, which could be used in order to switch the locale, for example.
|The general chat information, which is almost similar to the
|The ID of the chat, which is the same as the
message.from.id in private chats.
|The same as
message.from.first_name in private chats.
|The type of chat. Typically, this is set to "private".
|The timestamp of the sent message.
The Telegram user's text message. It is automatically used as
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.