← 返回
未分类 中文

TG Channel Manager

Universal config-driven content pipeline engine for any Telegram channel: news search via SearXNG, drafts, scheduled publishing, deduplication. All channel s...
通用配置驱动的内容管道引擎,支持任意 Telegram 频道:通过 SearXNG 搜索新闻、草稿、定时发布、去重。支持全部频道...
axisrow axisrow 来源
未分类 clawhub v0.0.3 1 版本 100000 Key: 无需
★ 0
Stars
📥 407
下载
💾 0
安装
1
版本
#automation#channel#content#latest#searxng#telegram

概述

TG Channel Manager

Pipeline: scout → draft → human approves → publisher.

Execution

python3 and curl are available in your environment (declared in requires.bins). Run all commands yourself using exec/bash tool. NEVER ask the user to run commands for you.

Startup

When you load this skill, run the preflight check FIRST:

python3 {baseDir}/scripts/tgcm.py --workspace {workspace} check

After check — act on results, don't ask:

  • All [ok] → proceed with the user's task silently
  • [fail] Bot token → ask the user for the token, then save it: tgcm.py config set bot-token . Do NOT ask where the token is or offer choices
  • [warn] SEARXNG_URL → ask the user for the URL, then save it: tgcm.py config set searxng-url . Proceed without it — scout won't work but other commands will
  • [fail] Channel → report which channel failed and why, include the fix from the output
  • [warn] No channels → mention it, but proceed — the user may want to init one

Settings saved via config set persist in tgcm/.config.json and are used by all subsequent commands.

NEVER ask follow-up questions about check results. Report what's wrong and the fix from the output.

If the user hasn't specified a task — just report the check status, nothing else.

CLI Reference (FULL list — NO other commands exist)

All commands: python3 {baseDir}/scripts/tgcm.py --workspace {workspace}

CommandWhat it does
----------------------
init Create a channel
listShow all channels
bind --channel-id IDBind channel to Telegram
info [--chat] [--subscribers] [--permissions] [--admins] [--all]Channel status
`get-id <@username\ID>`Resolve @username or numeric ID → full channel info (id, type, title)
checkPreflight: verify bot token, channels, env vars
config set Save setting locally (keys: bot-token, searxng-url)
config get Read a saved setting
config listShow all saved settings
fetch-posts [--limit N] [--dry-run]Load channel posts into dedup index (requires public channel with @username)
connect --channel-id ID [--channel-title T]Handle #tgcm connect event

Bot token is auto-resolved: --bot-token arg → $BOT_TOKEN env → openclaw.json (auto-search) → tgcm/.config.json. Just call tgcm.py get-id @username without --bot-token — the script finds the token itself. If auto-detection fails, save it once: tgcm.py config set bot-token .

Channel name validation: ^[a-z0-9][a-z0-9_-]{0,62}$.

Quick Reference

User saysDo this
--------------------
«узнай/определи channel-id»tgcm.py get-id @username
«подключи канал»Recipe: Connect a channel (ниже)
«какие каналы / список»tgcm.py list
«статус канала X»tgcm.py info X
«что в очереди»cat tgcm//content-queue.md
«загрузи посты / rebuild index»tgcm.py fetch-posts

Recipes

Look up channel ID

python3 {baseDir}/scripts/tgcm.py get-id @username

Token is found automatically. Returns channel id, type, and title.

Connect a channel

  1. Get ID: python3 {baseDir}/scripts/tgcm.py get-id @username
  2. python3 {baseDir}/scripts/tgcm.py --workspace {workspace} init
  3. python3 {baseDir}/scripts/tgcm.py --workspace {workspace} bind --channel-id
  4. Configure skills.entries["tg-channel-manager"].config in openclaw.json
  5. Add crons (see {baseDir}/references/cron-setup.md)

Load channel posts (rebuild dedup index)

python3 {baseDir}/scripts/tgcm.py --workspace {workspace} fetch-posts

Fetches posts from the channel's public page (t.me/s/) and adds them to content-index.json.

Options: --limit N (max pages, default 5), --dry-run (preview only).

Requires: channel must be public (have a @username).

View channels / status

  • tgcm.py list
  • tgcm.py info
  • Queue: cat tgcm//content-queue.md

Do NOT

  • Invent commands — the table above is the FULL list
  • Publish posts directly — only cron Publisher does this
  • Change draft → pending — only the human does this
  • Skip dedup-check before drafting
  • Ask the user to run commands — python3 and curl are available, use exec/bash yourself
  • Ask the user for bot token or env vars — token is auto-resolved, check shows what's wrong
  • Ask the user follow-up questions after check — report errors and the fix commands, don't offer choices
  • Ask whether it's a channel or group — get-id returns the type field, this skill is for channels only

Data Layout

tgcm/
  channels.json            <- [{"name", "channelId", "status", "createdAt"}, ...]
  {channel-name}/
    channel.json           <- per-channel metadata
    content-index.json     <- dedup index
    content-queue.md       <- post queue

A channel is bound when channelId is set and status is "connected".

Configuration

Parameters are read from openclaw.jsonskills.entries["tg-channel-manager"]:

Telegram

ParameterTypeDescription
------------------------------
config.channelIdstringTelegram channel ID for publishing
config.chatIdstringChannel community chat ID (optional)

Limits & Schedule

ParameterTypeDescription
------------------------------
config.maxPostsPerDaynumberMaximum posts per day
config.maxDraftsPerRunnumberMaximum drafts per scout run
config.timezonestringSchedule timezone (IANA format)
config.languagestringPost language (ru, en, ...)
config.cronScoutTimesstring[]Scout schedules (cron format)
config.cronPublisherTimesstring[]Publisher schedules (cron format)

Content

ParameterTypeDescription
------------------------------
config.rubricsarrayRubrics: [{id, emoji, name}, ...]
config.searchQueriesstring[]Search queries for SearXNG
config.searchIncludestringWhat to look for (filter description)
config.searchExcludestringWhat to discard (filter description)
config.evergreenstring[]Topics for articles when there are no news

Post Style

ParameterTypeDescription
------------------------------
config.postStyle.minCharsnumberMinimum characters per post
config.postStyle.maxCharsnumberMaximum characters per post
config.postStyle.emojiTitlebooleanEmoji before the title
config.postStyle.boldTitlebooleanBold title
config.postStyle.signaturestringPost signature
config.postStyle.newsFooterstringExtra text for news posts (empty = none)
config.postStyle.articleFooterstringExtra text for articles (empty = none)

Environment

ParameterTypeDescription
------------------------------
env.SEARXNG_URLstringSearXNG instance URL

Path Resolution

VariableHow to resolve
-------------------------
{workspace}Your CWD. Run pwd or use --workspace .
{baseDir}{workspace}/skills/tg-channel-manager

In sandbox mode (workspaceAccess: "none"), the workspace is under ~/.openclaw/sandboxes, not ~/.openclaw/workspace. Always use CWD-relative paths.

Cron setup: see {baseDir}/references/cron-setup.md.

Queue Format

Entry Format in content-queue.md

### <number>
- **Status:** draft | pending
- **Rubric:** <emoji> <name> (from config.rubrics)
- **Topic:** <topic>
- **Source:** <url> (for news)
- **Text:**

<post text>

Statuses:

  • draft — awaiting approval
  • pending — approved, ready for publishing

After publishing, the entry is removed from content-queue.md.

Deduplication

Before every draft — mandatory check:

python3 {baseDir}/scripts/dedup-check.py --base-dir <workspace> --topic "topic" --links "url1" "url2"

After publishing — add to index:

python3 {baseDir}/scripts/dedup-check.py --base-dir <workspace> --add <msgId> --topic "topic" --links "url"

Rebuild index (via Telegram search):

python3 {baseDir}/scripts/dedup-check.py --base-dir <workspace> --rebuild --channel-id <config.channelId>

Index is stored in /content-index.json (or per-channel: tgcm//content-index.json).

版本历史

共 1 个版本

  • v0.0.3 当前
    2026-05-12 05:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

humanizer-zh

liuxy951129-cpu
去除文本中的 AI 生成痕迹。适用于编辑或审阅文本,使其听起来更自然、更像人类书写。 基于维基百科的"AI 写作特征"综合指南。检测并修复以下模式:夸大的象征意义、 宣传性语言、以 -ing 结尾的肤浅分析、模糊的归因、破折号过度使用、三段
★ 63 📥 29,989
content-creation

Marketing Mode

thesethrose
{"answer":"营销模式整合23项全能技能,涵盖策略、心理、内容、SEO、转化优化及付费增长。适用于营销策略、文案、SEO、转化优化、付费广告及各类营销战术需求。"}
★ 161 📥 25,199
content-creation

Marketing Skills

jchopard69
访问 23 个营销模块,提供转化率优化(CRO)、SEO、文案撰写、分析、发布、广告和社交媒体的清单、框架及可直接使用的交付物。
★ 144 📥 31,202