Telegram Integration
Telegram integration allows a user to have a conversation with an agent via a Telegram Messenger Bot. This integration can easily be added to existing agents.
Create a Telegram Bot
- Within Telegram (Mobile, Desktop, or Web), click the search field and search for "BotFather."
- Click "BotFather" and click Start.
- Send the message "/newbot."
- Give your bot a name (e.g., Mike).
- Give your bot a username. Ensure it ends in "bot" and that it is one word (e.g., newo_bot). The username must be unique and not in use by someone else.
- Once you have successfully given your bot a username, you can access it via the link "t.me/[username]." Also, copy the HTTP API token to your clipboard.
Create a Telegram Connector
A Telegram connector needs to be created, which will be used to create an Event Subscription.
- Click the plus icon on the “Telegram Integration” item.
- Fill in the connector "Title" and "Idn." For this use case, let's say both are "telegram_connector."
- Paste the HTTP API token into the "Telegram API Token" field.
- Select the "Agent" you want to respond to messages in Telegram. In this case, you can use an existing agent from past examples (e.g., "Embedded Instructions" or "Embedded Context" agents.).
- Click Save.
Enable the Telegram Connector
Once a connector is created, its status will be "Stopped," and you will need to enable it.
- Click the three dots icon on the right of the created connector.
- Click Run.
Create an Event (Telegram Integration)
- Navigate to your agent's Flow. The agent should be the same one you selected when setting up a Telegram connector.
- Click the plus icon next to the Event Subscription section on the left-side panel.
- Under the “Event Idn,” select “user_message” from the dropdown.
- Under “Integration,” select “telegram” from the dropdown.
- Under “Connector,” select “telegram_connector” from the dropdown.
- Under “Skill selector,” select “skill_idn” from the dropdown. You are telling your flow that when a user messages the Telegram bot, select a specific Skill to activate.
- In this case, you want to activate the main Skill of your agent. Select it from the “Skill name” dropdown.
- Add an “Event description.” This field is optional but will help in the future when identifying the purpose of an event from a complex flow containing multiple event subscriptions.
- Click Create to save the event.
Test Functionality
- Click Save and Publish in the top-right corner of the Flow Builder.
- Within your newly created Telegram bot, click Start.
- Send a message and your digital employee should respond.
Updated 7 months ago