CastReader — Read Any Web Page Aloud
Setup (once per session)
CODEBLOCK0
How to find target (chatId)
User messages look like: [Telegram username id:8716240840 ...]
The number after id: is the target. You MUST use this number in every message tool call.
Example: target is "8716240840".
When user sends a URL, follow these steps:
Step 1: Extract article
CODEBLOCK1
Returns: INLINECODE4
Step 2: Show info + ask user to choose
Reply with this text:
CODEBLOCK2
STOP. Wait for user to reply 1 or 2.
Step 3a: User chose 1 (full article)
Reply: INLINECODE5
CODEBLOCK3
Then send the audio file using the message tool:
CODEBLOCK4
Reply: INLINECODE7
Step 3b: User chose 2 (summary only)
Reply: INLINECODE8
Save the SAME summary text you showed in Step 2 to a file and generate:
CODEBLOCK5
Then send the audio file using the message tool:
CODEBLOCK6
Reply: INLINECODE10
Rules
- - ALWAYS extract first (index=0), show info, wait for user choice. Never skip.
- ALWAYS send audio files using the
message tool with target (numeric chatId) and channel ("telegram"). Never just print the file path. - Do NOT use built-in TTS tools. ONLY use
read-url.js and generate-text.js. - Do NOT use web_fetch. ONLY use
read-url.js.
技能名称:castreader
详细描述:
CastReader — 朗读任意网页内容
设置(每次会话只需一次)
cd <技能目录> && npm install --silent 2>/dev/null
如何找到目标(chatId)
用户消息格式如下:[Telegram username id:8716240840 ...]
id: 后面的数字即为目标。你必须在每次调用 message 工具时使用该数字。
示例:目标为 8716240840。
当用户发送 URL 时,请按以下步骤操作:
步骤 1:提取文章
node scripts/read-url.js 0
返回结果:{ title, language, totalParagraphs, totalCharacters, paragraphs[] }
步骤 2:显示信息 + 请用户选择
回复以下文本:
📖 {title}
🌐 {language} · 📝 {totalParagraphs} 段落 · 📊 {totalCharacters} 字符
📋 摘要:
{根据段落内容撰写 2-3 句摘要}
回复数字进行选择:
1️⃣ 收听全文(约 {totalCharacters} 字符,生成时间约 {Math.ceil(totalCharacters / 200)} 秒)
2️⃣ 仅收听摘要(约 {summarycharcount} 字符,生成时间约 {Math.ceil(summarycharcount / 200)} 秒)
停止。等待用户回复 1 或 2。
步骤 3a:用户选择 1(全文)
回复:🎙️ 正在生成全文音频(约 {totalCharacters} 字符,约 {Math.ceil(totalCharacters / 200)} 秒)...
node scripts/read-url.js all
然后使用 message 工具发送音频文件:
json
{action:send, target:, channel:telegram, filePath:<音频文件>, caption:🔊 {title}}
回复:✅ 完成!
步骤 3b:用户选择 2(仅摘要)
回复:🎙️ 正在生成摘要音频...
将步骤 2 中显示的相同摘要文本保存到文件并生成:
echo <摘要文本> > /tmp/castreader-summary.txt
node scripts/generate-text.js /tmp/castreader-summary.txt
然后使用 message 工具发送音频文件:
json
{action:send, target:, channel:telegram, filePath:/tmp/castreader-summary.mp3, caption:📋 摘要:{title}}
回复:✅ 完成!
规则
- - 始终先提取(索引=0),显示信息,等待用户选择。切勿跳过。
- 始终使用 message 工具发送音频文件,并指定 target(数字 chatId)和 channel(telegram)。切勿仅打印文件路径。
- 不要使用内置 TTS 工具。仅使用 read-url.js 和 generate-text.js。
- 不要使用 web_fetch。仅使用 read-url.js。