← 返回
内容创作

Telegram Auto Topic

Add `/topic` to the start of any message in a Telegram forum group to auto-create a new topic from it. A title is generated automatically from the message content. Github: https://github.com/itstauq/telegram-auto-topic
在 Telegram 论坛群组的消息开头添加 `/topic`,即可自动根据消息内容生成标题并创建新主题。
itstauq
内容创作 clawhub v0.1.8 1 版本 99269.3 Key: 无需
★ 3
Stars
📥 3,744
下载
💾 573
安装
1
版本
#latest

概述

Telegram Auto-Topic

Add /topic to the start of any message in a Telegram forum group → a new topic is created from it. The title is figured out from your message automatically — no need to think of one yourself.

Example

1. You send a message starting with /topic:

> /topic @your_bot I need to look into renewing my passport before March

2. A new forum topic "Passport Renewal Before March" is created with your message quoted inside it. You get a reply linking directly to the new topic.

Prerequisites

  • The group must be configured in OpenClaw (channels.telegram.groups.) — this is how OpenClaw knows to process messages from it.
  • The group must have forum/topics enabled.
  • Your bot must be an admin in the group with Manage Topics permission.

Handling /topic

When a message starts with /topic:

  1. Generate a concise 3-7 word title summarising the message.
  2. Run the script — replace placeholders with actual values from the message context:

```

scripts/telegram-auto-topic.sh "" "" "<text after /topic>"</p><p> ```</p><p> Pass an empty string for the text arg if there's no text (e.g. media-only).</p><p> Use the path relative to this skill's directory.</p><ol><li>The script returns JSON with <code>topic_id</code>, <code>title</code>, and <code>link</code>.</li><li>Reply to the original message with: <code>Topic created → <a href="<link>" target="_blank" rel="noopener"><title></a></code></li><li>Then send a response to the actual message content in the NEW topic (use message tool with <code>threadId</code> from the returned <code>topic_id</code>). Respond naturally as you would to any message.</li><li>After both replies are sent, respond with NO_REPLY.</li></ol><h2>How It Works</h2><ol><li>You send a message starting with <code>/topic</code></li><li>A new forum topic is created — titled from your message automatically</li><li>Your message is quoted in the new topic with your name</li><li>You get a reply with a clickable link to the new topic</li><li>The bot responds to your message in the new topic</li></ol><p>Works with media too — photos, videos, or documents with <code>/topic</code> in the caption get forwarded into the new topic.</p><h2>Script Reference</h2><pre><code>scripts/telegram-auto-topic.sh <chat_id> <message_id> <sender> [title] [text] </code></pre><table><thead><tr><th>Parameter</th><th>Type</th><th>Required</th><th>Description</th></tr></thead><tbody><tr><td>-----------</td><td>------</td><td>----------</td><td>-------------</td></tr><tr><td><code>chat_id</code></td><td>arg</td><td>yes</td><td>Supergroup chat ID (negative number)</td></tr><tr><td><code>message_id</code></td><td>arg</td><td>yes</td><td>Original message to quote</td></tr><tr><td><code>sender</code></td><td>arg</td><td>yes</td><td>Display name of original sender</td></tr><tr><td><code>title</code></td><td>arg</td><td>no</td><td>Topic title. Falls back to first ~50 chars of text if omitted</td></tr><tr><td><code>text</code></td><td>arg</td><td>no</td><td>Message body after <code>/topic</code>. If empty, forwards as media</td></tr></tbody></table><p>Returns JSON: <code>{"topic_id": 123, "title": "Used title", "link": "https://t.me/c/..."}</code></p><h2>Optional configuration</h2><p><strong>Skip the @bot mention</strong> — by default, the bot only responds when mentioned. To use <code>/topic</code> without mentioning the bot:</p><pre><code>"channels.telegram.groups.<CHAT_ID>": { "requireMention": false } </code></pre><p><strong>Telegram autocomplete</strong> — to get <code>/topic</code> in Telegram's command menu, add under <code>channels.telegram</code>:</p><pre><code>{ "customCommands": [ { "command": "topic", "description": "Create a new forum topic from a message" } ] } </code></pre><h2>Limitations</h2><ul><li><strong>Attribution:</strong> Quoted messages appear as sent by the bot (Telegram API limitation). Sender name is included as attribution text below the quote.</li><li><strong>Media:</strong> Forwarded media shows a "Forwarded from" header — best available but not native.</li><li><strong>Forum groups only:</strong> Won't work in regular groups or DMs.</li><li><strong>Permissions:</strong> Bot needs admin with Manage Topics.</li><li><strong>Title length:</strong> Telegram caps topic names at 128 characters.</li></ul></div> </div> </div> <div id="tab-versions" class="detail-content"> <div class="detail-section"> <h2>版本历史</h2> <p style="margin-bottom:12px;font-size:14px;color:#94a3b8;">共 1 个版本</p> <ul class="version-list"> <li> <div> <span class="version-tag">v0.1.8</span> <span style="font-size:11px;color:#5b6abf;margin-left:8px;background:#eef0ff;padding:1px 8px;border-radius:10px;">当前</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-03-28 10:54 安全 安全 </div> </li> </ul> </div> </div> <div id="tab-security" class="detail-content"> <div class="detail-section"> <h2>安全检测</h2> <div class="sec-grid"> <div class="sec-card"> <h4>腾讯云安全 (Keen)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://tix.qq.com/search/skill?keyword=785babd6ee99bc8241617e7c7ebdb585" target="_blank">查看报告</a> </div> <div class="sec-card"> <h4>腾讯云安全 (Sanbu)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://static.cloudsec.tencent.com/html-report-v2/2026/05/25/390586_b929335d6920583ec19b2644090e9e68.html?q-sign-algorithm=sha1&q-ak=AKID8JMG1bzBC1dz96qNhssfFftujT1NCoFi&q-sign-time=1781281581%3B1812817581&q-key-time=1781281581%3B1812817581&q-header-list=host&q-url-param-list=&q-signature=9c4bc3cee3bbd09873c758208d1eb42a287039d4" target="_blank">查看报告</a> </div> </div> </div> </div> <!-- Recommended Skills --> <div style="margin-top:24px;"> <h2 style="font-size:18px;font-weight:600;margin-bottom:16px;">🔗 相关推荐</h2> <div class="rec-grid"> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">content-creation</span> <h3><a href="/s/humanizer">Humanizer</a></h3> <div class="rec-owner">biostartechnology</div> <div class="rec-desc">消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 857</span> <span style="color:#5b6abf;">📥 199,252</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">content-creation</span> <h3><a href="/s/youtube-api-skill">YouTube</a></h3> <div class="rec-owner">byungkyu</div> <div class="rec-desc">使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 141</span> <span style="color:#5b6abf;">📥 41,015</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">content-creation</span> <h3><a href="/s/admapix">AdMapix</a></h3> <div class="rec-owner">fly0pants</div> <div class="rec-desc">广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 294</span> <span style="color:#5b6abf;">📥 136,400</span> </div> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded',function(){ document.querySelectorAll('.detail-tab').forEach(function(btn){ btn.addEventListener('click',function(e){ var tab = this.getAttribute('data-tab'); document.querySelectorAll('.detail-tab').forEach(function(b){b.classList.remove('active')}); document.querySelectorAll('.detail-content').forEach(function(c){c.classList.remove('active')}); this.classList.add('active'); var el = document.getElementById('tab-'+tab); if(el) el.classList.add('active'); }); }); }); </script> <div class="footer"> <p>Skill工具集 © 2026</p> </div></body> </html>