Connecting Telegram
Table of Contents
Connect your Agento agent to Telegram so you can chat with it from your phone, desktop, or any Telegram client. This guide walks you through creating a Telegram bot and linking it to your agent.
Prerequisites
Before you start, make sure you have:
- An Agento account with a running agent
- A Telegram account
- The Telegram app installed on your phone or desktop
Create a Telegram Bot
Telegram bots are created through BotFather, Telegram's official bot management tool.
- Open Telegram and search for @BotFather
- Start a chat and send
/newbot - BotFather will ask for a display name โ enter something like "My Agento Bot"
- BotFather will ask for a username โ this must end in
bot(e.g.my_agento_bot) - BotFather will give you an API token โ copy it
The token looks like 123456789:ABCdefGhIjKlMnOpQrStUvWxYz. Keep it secure.
Connect the Bot to Your Agent
- Open the Agento dashboard and click on your agent
- Go to the Channels tab
- Click Add Channel and select Telegram
- Paste your BotFather token
- Click Connect
Agento will verify the token and register a webhook with Telegram. You'll see a green "Connected" status when it's ready.
Test the Connection
- Open Telegram and search for your bot's username (e.g.
@my_agento_bot) - Click Start to begin the conversation
- Send a message โ your Agento agent will respond through the bot
Messages flow in real time: Telegram sends them to Agento, your agent processes them with the configured AI model, and the response is sent back to Telegram.
Customize Your Bot
You can customize how your Telegram bot appears:
Set a Profile Picture
- Open a chat with @BotFather
- Send
/setuserpic - Select your bot
- Upload a profile picture
Set a Description
- Send
/setdescriptionto BotFather - Select your bot
- Type a short description that appears when users first open the bot
Set Commands
- Send
/setcommandsto BotFather - Select your bot
- Enter commands in the format
command - Description(one per line)
Managing Access
By default, anyone on Telegram can message your bot. To restrict access:
- Private bot: In your agent's system prompt, instruct it to only respond to specific users or require a password
- Group bot: Add the bot to a Telegram group where it will respond to messages that mention it or reply to its messages
Disconnecting
To disconnect Telegram from your agent:
- Go to your agent's Channels tab
- Click the Disconnect button next to Telegram
This removes the webhook. The Telegram bot will still exist but won't respond to messages.
Troubleshooting
Bot doesn't respond: Make sure your agent is running (green status on the dashboard). A stopped agent can't process messages.
"Invalid token" error: Copy the token directly from BotFather. Make sure there are no extra spaces or line breaks.
Messages are delayed: This usually means the AI provider is slow to respond. Check your agent's model settings โ faster models like Claude Haiku or Gemini Flash will respond more quickly.