← Back to library

Telegram 论坛群一键建话题:用 message 工具创建 topic 并做分流

解决超群讨论串混乱问题:先程序化创建 forum topic,再把任务/告警写入对应话题,避免所有消息挤在主聊天流。

GITHUBDiscovered 2026-02-18Author @ganeshkarthikm
Prerequisites
  • Telegram supergroup must have forum mode enabled, and your bot/admin account can create topics.
  • You know the target chat id (typically starts with -100...) and your OpenClaw message tool is connected to Telegram.
Steps
  1. Confirm channel connectivity and permissions; verify bot can post in the supergroup.
  2. Create a forum topic via message action topic-create with a clear business name.
  3. Record returned topic/thread identifier in your routing config/state file.
  4. Route subsequent alerts/workflow messages to that topic instead of root chat.
  5. Run a dry run with two categories (e.g., deploy, incidents) to validate separation.
Commands
message action="topic-create" channel="telegram" to="-100123456789" name="Ops Alerts"
message action="send" channel="telegram" to="-100123456789" threadId="<topic_thread_id>" message="[test] topic routing online"
Verify

New topic is visible in the group forum tab, and test messages land inside the target topic thread (not main chat).

Caveats
  • topic-create is Telegram-specific; other channels do not support this action.
  • Different bots/groups may expose different thread id fields; exact mapping in your environment still needs verification(需验证).
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post