Telegram
Connect an agent to a Telegram bot so it handles user conversations. Telegram is connected per agent in the Channels tab of the agent builder.
Prerequisites
- A saved agent (the Channels tab is locked until the agent is saved).
- A Telegram bot created with @BotFather , and its bot token.
What you’ll need from Telegram
| Field | Where to find it | Required |
|---|---|---|
| Bot Token | @BotFather (looks like 123456789:ABCdef...) | Yes |
| Bot Username | The bot’s @username from @BotFather | No |
| Webhook Secret | Any value you choose, for extra request verification | No |
How to connect
- Create the botMessage @BotFather, create a bot, and copy the bot token.
- Enter the token in TeamMateIn the agent’s Channels tab, open Telegram → Configure and paste the bot token (and optionally the username and a webhook secret).
- SaveTeamMate registers the webhook automatically when you save — you don’t paste a URL into Telegram yourself.
- Send a test messageStart the bot in Telegram (send /start), then use the Send Test Message step with that chat ID to confirm delivery.
The webhook URL TeamMate registers is https://tmmate.ai/api/webhook/telegram/<agentId>.
What the agent can do
- Reply to direct messages with the bot.
- Send AI-generated responses to users who have started the bot.
Limits
- Use a unique bot per agent. Telegram supports only one webhook endpoint per bot token, so the same bot can’t serve two agents.
- The agent can only message a user after that user has started the bot (sent
/start).
Troubleshooting
- Test message fails. The recipient must have started the bot first; use a chat ID where
/starthas already been sent. - No replies after setup. Confirm the bot token is correct and that this bot isn’t already pointed at another webhook.