docs/channels/telegram.mdx
Integrate CowAgent into Telegram via the official Bot API. Supports private chat and group chat (triggered by @mention or replying to the bot). Uses Long Polling — no public IP required, works out of the box.
/newbot and follow the prompts:
My CowAgent Bot)bot, e.g. my_cowagent_bot)123456789:ABCdefGhIJKlmNoPQRsTUVwxyZ). Keep it safe.Skip this step if you only use private chat. Telegram bots run in Privacy Mode by default — in groups they can only see commands suffixed with @bot (e.g. /start@your_bot) and replies to bot messages; plain @bot hello text messages are not delivered, so the bot will appear unresponsive in groups.
Send the following to @BotFather:
/setprivacyDisable```json
{
"channel_type": "telegram",
"telegram_token": "123456789:ABCdefGhIJKlmNoPQRsTUVwxyZ",
"telegram_group_trigger": "mention_or_reply"
}
```
| Key | Description | Default |
| --- | --- | --- |
| `telegram_token` | HTTP API Token returned by BotFather | - |
| `telegram_group_trigger` | Group trigger: `mention_or_reply` (@ or reply) / `mention_only` (@ only) / `all` (all messages) | `mention_or_reply` |
| `telegram_register_commands` | Whether to register the command menu with BotFather on startup | `true` |
The integration is ready when you see logs like:
[Telegram] Bot logged in as @my_cowagent_bot (id=123456789)
[Telegram] Registered 10 bot commands
[Telegram] ✅ Telegram bot ready, polling for updates
| Feature | Support |
|---|---|
| Private chat | ✅ |
| Group chat (@bot / reply to bot) | ✅ |
| Text messages | ✅ send / receive |
| Image messages | ✅ send / receive |
| Voice messages | ✅ send / receive (OGG/Opus) |
| Video messages | ✅ send / receive |
| File messages | ✅ send / receive (PDF / Word / Excel, etc.) |
| Command menu | ✅ aligned with Web Console slash commands |
On startup, the channel registers a command menu with BotFather. Typing / in Telegram shows a dropdown:
| Command | Description |
|---|---|
/help | Show command help |
/status | View runtime status |
/context | View conversation context (/context clear to clear) |
/skill | Skill management (/skill list, /skill install, ...) |
/memory | Memory management (/memory dream) |
/knowledge | Knowledge base (/knowledge list / on / off) |
/config | View current config |
/cancel | Cancel the running Agent task |
/logs | View recent logs |
/version | Show version |
Once connected:
@my_cowagent_bot) in Telegram, click Start and chat away.@bot hello or by replying to one of the bot's messages. If the bot doesn't respond in groups, double-check Privacy Mode in Step 2.When sending an image or file, you can add a caption (description / question) directly in the attachment input — the bot will answer based on both. Sending an attachment first and then a follow-up question also works; the two messages are merged automatically.