Install
openclaw skills install telegram-opsClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
Telegram Bot API operations for forum management. Use for creating/editing/archiving forum topics, setting topic icons, managing Telegram groups via Bot API. Use when archiving channels/topics. Requires bot token from OpenClaw config.
openclaw skills install telegram-opsManage Telegram forum topics and Bot API operations.
can_manage_topics permissiongateway action=config.get | jq -r '.result.parsed.channels.telegram.botToken'
When creating a topic, follow all of these steps:
message_thread_id)openclaw skills list, pick only ready skills that fit the topic's purposecurl -X POST "https://api.telegram.org/bot<TOKEN>/createForumTopic" \
-H "Content-Type: application/json" \
-d '{
"chat_id": <GROUP_ID>,
"name": "topic name"
}'
Returns message_thread_id (the topic ID) -- you need this for all subsequent steps.
curl -X POST "https://api.telegram.org/bot<TOKEN>/editForumTopic" \
-H "Content-Type: application/json" \
-d '{
"chat_id": <GROUP_ID>,
"message_thread_id": <TOPIC_ID>,
"name": "topic name",
"icon_custom_emoji_id": "<EMOJI_ID>"
}'
Patch the config to register the topic with a system prompt:
gateway action=config.patch raw='{"channels":{"telegram":{"groups":{"<GROUP_ID>":{"topics":{"<TOPIC_ID>":{"systemPrompt":"Topic-specific instructions"}}}}}}}'
Topic configs inherit from the parent group -- only specify overrides.
Do NOT add a skills key -- omitting it means all skills are available. Only restrict skills if you have a specific reason to limit the topic's capabilities.
Each topic gets its own isolated OpenClaw session:
agent:main:telegram:group:<GROUP_ID>:topic:<TOPIC_ID>
Each session has independent conversation history, context window, and compaction.
| Emoji | ID | Use Case |
|---|---|---|
| ⚡ | 5312016608254762256 | Ops, speed, alerts |
| 💡 | 5312536423851630001 | Ideas, suggestions |
| 📰 | 5434144690511290129 | News, announcements |
| 🔥 | 5312241539987020022 | Hot topics, urgent |
| ❤️ | 5312138559556164615 | Community, love |
| 📝 | 5373251851074415873 | Notes, documentation |
| 🤖 | 5309832892262654231 | Bots, automation |
| 💬 | 5417915203100613993 | Chat, discussion |
| 📊 | 5350305691942788490 | Stats, analytics |
| 🎯 | 5418085807791545980 | Goals, targets |
See references/emoji-ids.md for complete list.
To fetch all valid icon sticker IDs:
curl -X POST "https://api.telegram.org/bot<TOKEN>/getForumTopicIconStickers"
Archive workflow: rename with [ARCHIVED] prefix, set folder icon, close topic, then handle the OpenClaw session.
Use the archive script:
scripts/archive_topic.sh <TOKEN> <GROUP_ID> <TOPIC_ID> "Current Topic Name"
This will:
[ARCHIVED] Current Topic Name5357315181649076022)# Export session history to the sessions archive folder
openclaw sessions history 'agent:main:telegram:group:<GROUP_ID>:topic:<TOPIC_ID>' > ~/.openclaw/agents/main/sessions/archive/<topic-name>-<date>.md
# Delete the session (manual - remove from sessions.json and delete transcript)
# Session key: agent:main:telegram:group:<GROUP_ID>:topic:<TOPIC_ID>
Remove the topic from OpenClaw config if it had custom settings:
gateway action=config.patch raw='{"channels":{"telegram":{"groups":{"<GROUP_ID>":{"topics":{"<TOPIC_ID>":null}}}}}}'
No getForumTopicInfo method exists. Cannot query topic name by thread ID.
Workarounds:
forum_topic_created events