itstauq

Telegram Auto Topic

AI 智慧體v0.1.8
作者:itstauq更新於 2026-05-11共 9 個版本 · 最新版本釋出於 2026-02-12telegram-auto-topic@clawhub_itstauq/telegram-auto-topic
任務自動化#Telegram#Message

據 AlphaMoat 統計,截至 2026-09,Telegram Auto Topic 累計下載 4,489 次、獲 3 個星標,在全部 5,078 個 AI 技能中排名第 2,150 位,在「AI 智慧體」分類(969 個)中排名第 410 位。

累計安裝
573
累計下載
4489
星標
3
全站排名
#2,150
全站前 43% · 「AI 智慧體」前 43%
平台累計安裝累計下載星標評論
ClawHub ↗13839543-
SkillHub ↗57344893—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

在群裡發一條以 /topic 開頭的訊息,就會為它新建一個話題,標題由訊息內容自動取,不必自己想。前提是群已在 OpenClaw 的頻道配置裡登記、群已啟用話題模式,且機器人是群管理員並擁有管理話題許可權。三個前提缺一不可。使用僅具備所需群組權限的專用 bot token,並保護 OpenClaw 設定;廣泛部署前檢查命令如何處理 token。確認目標群組已啟用論壇主題,且機器人是管理員並擁有 Manage Topics 權限。

資料釋出於 2026-10-27

可以用來做什麼

  • 把一條討論按主題拆成獨立話題
  • 在群裡快速建一個按內容命名的話題

什麼時候用

  • 群裡話題多、需要分門別類時
  • 不想手動起標題時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

在群裡用這條訊息開個新話題
幫我把這周的討論按主題分話題

月度資料趨勢

累計下載4489
3401398645702026-03 · 累計下載 34822026-05 · 累計下載 37212026-06 · 累計下載 35902026-07 · 累計下載 39342026-08 · 累計下載 40492026-09 · 累計下載 448926-0326-09
星標3
2342026-03 · 星標 32026-05 · 星標 32026-06 · 星標 32026-07 · 星標 32026-08 · 星標 32026-09 · 星標 326-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094489—3
2026-084049+2.9%3
2026-073934+9.6%3
2026-063590-3.5%3
2026-053721—3
2026-033482—3

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

4.0 KB · ClawHub v0.1.8
---
name: telegram-auto-topic
description: >
  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
metadata:
  openclaw:
    requires:
展開全部(共 109 行)
      config:
        - ~/.openclaw/openclaw.json
      env:
        - OPENCLAW_CONFIG
      bins:
        - curl
        - jq
---

# 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.<CHAT_ID>`) — 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 <chat_id> <message_id> "<sender name>" "<title>" "<text after /topic>"
   ```
   Pass an empty string for the text arg if there's no text (e.g. media-only).
   Use the path relative to this skill's directory.
3. The script returns JSON with `topic_id`, `title`, and `link`.
4. Reply to the original message with: `Topic created → [<title>](<link>)`
5. Then send a response to the actual message content in the NEW topic (use message tool with `threadId` from the returned `topic_id`). Respond naturally as you would to any message.
6. After both replies are sent, respond with NO_REPLY.

## How It Works

1. You send a message starting with `/topic`
2. A new forum topic is created — titled from your message automatically
3. Your message is quoted in the new topic with your name
4. You get a reply with a clickable link to the new topic
5. The bot responds to your message in the new topic

Works with media too — photos, videos, or documents with `/topic` in the caption get forwarded into the new topic.

## Script Reference

```bash
scripts/telegram-auto-topic.sh <chat_id> <message_id> <sender> [title] [text]
```

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `chat_id` | arg | yes | Supergroup chat ID (negative number) |
| `message_id` | arg | yes | Original message to quote |
| `sender` | arg | yes | Display name of original sender |
| `title` | arg | no | Topic title. Falls back to first ~50 chars of text if omitted |
| `text` | arg | no | Message body after `/topic`. If empty, forwards as media |

Returns JSON: `{"topic_id": 123, "title": "Used title", "link": "https://t.me/c/..."}`

## Optional configuration

**Skip the @bot mention** — by default, the bot only responds when mentioned. To use `/topic` without mentioning the bot:

```json
"channels.telegram.groups.<CHAT_ID>": {
  "requireMention": false
}
```

**Telegram autocomplete** — to get `/topic` in Telegram's command menu, add under `channels.telegram`:

```json
{
  "customCommands": [
    {
      "command": "topic",
      "description": "Create a new forum topic from a message"
    }
  ]
}
```

## Limitations

- **Attribution:** Quoted messages appear as sent by the bot (Telegram API limitation). Sender name is included as attribution text below the quote.
- **Media:** Forwarded media shows a "Forwarded from" header — best available but not native.
- **Forum groups only:** Won't work in regular groups or DMs.
- **Permissions:** Bot needs admin with Manage Topics.
- **Title length:** Telegram caps topic names at 128 characters.

「AI 智慧體」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。