Read posts and comments from Telegram channels via MTProto (Pyrogram or Telethon). Fetch recent messages and discussion replies from public or private channe...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install sergei-mikhailov-tg-channel-reader或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install sergei-mikhailov-tg-channel-reader⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/sergei-mikhailov-tg-channel-reader/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: sergei-mikhailov-tg-channel-reader description: Read posts and comments from Telegram channels via MTProto (Pyrogram or Telethon). Fetch recent messages and discussion replies from public or private channels by time window. metadata: {"openclaw": {"emoji": "📡", "requires": {"bins": ["tg-reader", "tg-reader-check"], "env": ["TG_API_ID", "TG_API_HASH"]}, "primaryEnv": "TG_API_HASH"}} ---
Read posts and comments from Telegram channels using MTProto (Pyrogram or Telethon). Works with any public channel and private channels the user is subscribed to. Supports fetching discussion replies (comments) for individual posts.
> Security notice: This skill requires TG_API_ID and TG_API_HASH from my.telegram.org. The session file grants full Telegram account access — store it securely and never share it.
---
> Just installed via clawhub install? Complete Setup & Installation (below) first — the skill needs pip install, credentials, and a session file before exec approvals matter.
OpenClaw blocks unknown CLI commands by default. The user must approve tg-reader commands before they can run. If the command hangs or the user says nothing is happening — exec approval is likely pending.
Run from the skill directory — checks prerequisites, installs pip packages if needed, and prints the approval commands to run:
cd ~/.openclaw/workspace/skills/sergei-mikhailov-tg-channel-reader
bash setup-tg-reader.sh
openclaw approvals allowlist add --gateway "$(which tg-reader)"
openclaw approvals allowlist add --gateway "$(which tg-reader-check)"
openclaw approvals allowlist add --gateway "$(which tg-reader-telethon)"
http://localhost:18789/, find the pending approval for tg-reader, click "Always allow". Docs. Reply: /approve allow-always . Other options: allow-once, deny.The approval prompt appears in the Control UI or as a bot message — not in the agent's conversation. This is a common source of confusion.
---
tg-reader info---
# 1. Run pre-flight diagnostic (fast, no Telegram connection)
tg-reader-check
# 2. Get channel info
tg-reader info @channel_name
# 3. Fetch recent posts
tg-reader fetch @channel_name --since 24h
> tg-reader: command not found? Run bash setup-tg-reader.sh from the skill directory (it will install the package), or manually: cd ~/.openclaw/workspace/skills/sergei-mikhailov-tg-channel-reader && pip install .
---
tg-reader-check — Pre-flight DiagnosticAlways run before fetching. Fast offline check — no Telegram connection needed.
tg-reader-check
tg-reader-check --config-file /path/to/config.json
tg-reader-check --session-file /path/to/session
Returns JSON with "status": "ok" or "status": "error" plus a problems array.
Verifies:
~/.tg-reader.json)tg-reader info — Channel Infotg-reader info @channel_name
Returns title, description, subscriber count, and link.
tg-reader fetch — Read Posts# Last 24 hours (default)
tg-reader fetch @channel_name --since 24h
# Last 7 days, up to 200 posts
tg-reader fetch @channel_name --since 7d --limit 200
# Multiple channels (fetched sequentially with 10s delay between each)
tg-reader fetch @channel1 @channel2 @channel3 --since 24h
# Custom delay between channels (seconds)
tg-reader fetch @channel1 @channel2 @channel3 --since 24h --delay 5
# Fetch posts with comments (single channel only, limit auto-drops to 30)
tg-reader fetch @channel_name --since 7d --comments
# More comments per post, custom delay between posts
tg-reader fetch @channel_name --since 24h --comments --comment-limit 20 --comment-delay 5
# Skip posts without text (media-only, no caption)
tg-reader fetch @channel_name --since 24h --text-only
# Human-readable output
tg-reader fetch @channel_name --since 24h --format text
# Write output to file instead of stdout (saves tokens)
tg-reader fetch @channel_name --since 24h --output
tg-reader fetch @channel_name --since 24h --comments --output comments.json
# Use Telethon instead of Pyrogram (one-time)
tg-reader fetch @channel_name --since 24h --telethon
# Read unread mode — only fetch new (unread) posts, no --since needed
# Requires "read_unread": true in ~/.tg-reader.json
tg-reader fetch @channel_name
# Override read_unread mode (fetch everything, don't update state)
tg-reader fetch @channel_name --since 7d --all
# Custom state file location
tg-reader fetch @channel_name --since 24h --state-file /path/to/state.json
tg-reader auth — First-time Authenticationtg-reader auth
Creates a session file. Only needed once.
---
Only return new (unread) posts — the skill remembers what you've already seen. Useful for daily digests and monitoring workflows.
Option A — config file (~/.tg-reader.json):
{
"api_id": 12345,
"api_hash": "...",
"read_unread": true
}
Option B — env var (works with ~/.openclaw/openclaw.json):
export TG_READ_UNREAD=true
Env vars take priority over the config file. This lets you enable read_unread via openclaw.json Docker env alongside TG_API_ID/TG_API_HASH.
State is stored in ~/.tg-reader-state.json (configurable via "state_file" in config, TG_STATE_FILE env var, or --state-file flag).
--since is not needed when read_unread is enabled — the skill automatically returns all unread posts regardless of time--since applies as usual (default 24h); state file created--since is ignored--all flag: bypasses read_unread mode — fetches everything by --since without updating state (preserves your position)count: 0 returned# With read_unread enabled — just fetch, no --since needed
tg-reader fetch @channel_name
# First run for a new channel — --since determines initial window
tg-reader fetch @new_channel --since 7d
# Override: fetch everything, don't update tracking state
tg-reader fetch @channel_name --since 7d --all
When read_unread mode is active, the JSON output includes a read_unread field:
{
"channel": "@channel_name",
"read_unread": {"enabled": true},
"count": 5,
"messages": [...]
}
With --all: "read_unread": {"enabled": true, "overridden": true}
tg-reader-check reports tracking status:
{
"tracking": {
"read_unread": true,
"state_file": "~/.tg-reader-state.json",
"state_file_exists": true,
"tracked_channels": 3
}
}
---
info...
安装 Telegram Channel Reader 后,可以对 AI 说这些话来触发它
Help me get started with Telegram Channel Reader
Explains what Telegram Channel Reader does, walks through the setup, and runs a quick demo based on your current project
Use Telegram Channel Reader to read posts and comments from Telegram channels via MTProto (Pyrogra...
Invokes Telegram Channel Reader with the right parameters and returns the result directly in the conversation
What can I do with Telegram Channel Reader in my marketing & growth workflow?
Lists the top use cases for Telegram Channel Reader, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/sergei-mikhailov-tg-channel-reader/ 目录(个人级,所有项目可用),或 .claude/skills/sergei-mikhailov-tg-channel-reader/(项目级)。重启 AI 客户端后,用 /sergei-mikhailov-tg-channel-reader 主动调用,或让 AI 根据上下文自动发现并使用。
Telegram Channel Reader 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Telegram Channel Reader 可免费安装使用。请查阅仓库了解许可证信息。
Read posts and comments from Telegram channels via MTProto (Pyrogram or Telethon). Fetch recent messages and discussion replies from public or private channe...
Telegram Channel Reader 属于「Marketing & Growth」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my marketing & growth tasks using Telegram Channel Reader
Identifies repetitive steps in your workflow and sets up Telegram Channel Reader to handle them automatically