Telegram Group Chat - Smart Reply Logic
This skill provides intelligent reply judgment for Telegram group chats. The goal: be helpful without spamming — reply when valuable, stay silent when unnecessary.
Core Principle
Quality > Quantity. If you wouldn't send it in a real group chat with friends, don't send it.
Reply Judgment Rules
✅ Respond When (ANY one)
- 1. @mentioned — Must reply when @mentioned by username
- Questions detected — Message contains
? ? or question words:
- Chinese: 什么/怎么/为什么/如何/哪里/谁
- English: what/how/why/where/who/which/when
- 3. Called by name — Message contains your name (e.g., "Echo")
- Technical topics — You can help with: code, api, config, error, bug, deploy, bot, openclaw, telegram, webhook, token
- Priority user — Messages from configured priority users (e.g., your human)
❌ Skip Reply When (ANY one)
- 1. Other bots —
from.is_bot == true (avoids bot infinite loops) - Only emoji — No text content, just emoji
- Too short — <3 Chinese characters OR <1 English word
- Small talk — Without @: 早安/晚安/吃了吗/hello/hi/hey/good morning
- Cooldown active — Same topic replied within 5 minutes
Implementation: NO_REPLY Mechanism
When skipping a reply, respond with ONLY:
CODEBLOCK0
OpenClaw treats this as a silent ack — the message is processed but not sent to the chat.
Important: NO_REPLY must be your ENTIRE response. Never append it to actual replies.
Configuration Template
Add to your AGENTS.md or workspace config:
CODEBLOCK1
Example Scenarios
| Message | Should Reply? | Reason |
|---|
| "@Echo 怎么配置 Telegram bot?" | ✅ Yes | @mention + question |
| "有人知道 API 怎么调吗?" |
✅ Yes | Question + technical |
| "Echo 你觉得呢?" | ✅ Yes | Called by name |
| "早安大家" | ❌ No | Small talk without @ |
| "👍" | ❌ No | Only emoji |
| "好" | ❌ No | Too short |
| (Bot message) "Welcome!" | ❌ No | From other bot |
| "刚才那个问题还有人吗?" | ❌ No | Replied 3min ago (cooldown) |
Multi-Bot Groups
When multiple OpenClaw bots are in the same group:
- 1. Each bot needs independent config — Same rules, different instances
- Avoid bot loops — Never reply to other bots' messages
- Use @ for directed questions — "@BotA 和 @BotB 你们觉得呢?"
- Stagger responses — If multiple bots could reply, let the most relevant one respond
Testing Checklist
- - [ ] @mention triggers reply
- [ ] Questions trigger reply
- [ ] Emoji-only messages skipped
- [ ] Other bot messages skipped
- [ ] Cooldown prevents spam
- [ ]
NO_REPLY not sent to chat
Related
- - OpenClaw Telegram channel docs: INLINECODE6
- NO_REPLY pattern: Built into OpenClaw gateway
Telegram 群聊 - 智能回复逻辑
本技能为 Telegram 群聊提供智能回复判断。目标:在不刷屏的前提下提供帮助 — 有价值时回复,无必要时保持沉默。
核心原则
质量 > 数量。 如果你不会在真实的朋友群聊中发送这条消息,那就不要发送。
回复判断规则
✅ 需要回复的情况(满足任意一条)
- 1. 被@提及 — 当被用户名@时必须回复
- 检测到问题 — 消息包含 ? ? 或疑问词:
- 中文:什么/怎么/为什么/如何/哪里/谁
- 英文:what/how/why/where/who/which/when
- 3. 被叫名字 — 消息包含你的名字(例如Echo)
- 技术话题 — 你能提供帮助的领域:代码、API、配置、错误、bug、部署、机器人、OpenClaw、Telegram、Webhook、Token
- 优先用户 — 来自已配置优先用户的消息(例如你的主人)
❌ 跳过回复的情况(满足任意一条)
- 1. 其他机器人 — from.is_bot == true(避免机器人无限循环)
- 仅含表情 — 无文本内容,只有表情符号
- 内容过短 — <3个中文字符 或 <1个英文单词
- 闲聊内容 — 未@时:早安/晚安/吃了吗/hello/hi/hey/good morning
- 冷却中 — 同一话题在5分钟内已回复过
实现方式:NO_REPLY 机制
当跳过回复时,仅返回:
NO_REPLY
OpenClaw 将其视为静默确认 — 消息已被处理但不会发送到群聊中。
重要: NO_REPLY 必须是你的完整回复。切勿将其附加到实际回复内容中。
配置模板
添加到你的 AGENTS.md 或工作区配置中:
markdown
💬 群聊回复规则(Telegram:YOURGROUPID)
需要回复的情况(满足任意一条):
- - 被@提及(必须回复)
- 消息包含问题(? ? 或 什么/怎么/为什么/how/what/why)
- 被叫名字:YourName
- 技术话题(代码、API、配置、错误、bug、机器人、OpenClaw、Telegram)
- 来自优先用户 USER_ID 的消息
跳过回复的情况(满足任意一条):
- - 来自其他机器人(from.is_bot == true)
- 仅含表情,无文本
- 内容过短(<3个中文字符 或 <1个英文单词)
- 未@时的闲聊(早安/晚安/吃了吗/hello/hi)
- 同一话题在5分钟内已回复过(冷却)
静默回复: 跳过时,仅回复 NO_REPLY
示例场景
| 消息 | 是否回复? | 原因 |
|---|
| @Echo 怎么配置 Telegram bot? | ✅ 是 | @提及 + 问题 |
| 有人知道 API 怎么调吗? |
✅ 是 | 问题 + 技术话题 |
| Echo 你觉得呢? | ✅ 是 | 被叫名字 |
| 早安大家 | ❌ 否 | 未@时的闲聊 |
| 👍 | ❌ 否 | 仅含表情 |
| 好 | ❌ 否 | 内容过短 |
| (机器人消息)Welcome! | ❌ 否 | 来自其他机器人 |
| 刚才那个问题还有人吗? | ❌ 否 | 3分钟前已回复(冷却中) |
多机器人群组
当多个 OpenClaw 机器人在同一群组中时:
- 1. 每个机器人需要独立配置 — 相同规则,不同实例
- 避免机器人循环 — 绝不回复其他机器人的消息
- 使用@进行定向提问 — @BotA 和 @BotB 你们觉得呢?
- 错开回复 — 如果多个机器人都能回复,让最相关的一个来回复
测试清单
- - [ ] @提及触发回复
- [ ] 问题触发回复
- [ ] 仅含表情的消息被跳过
- [ ] 其他机器人的消息被跳过
- [ ] 冷却机制防止刷屏
- [ ] NO_REPLY 不会发送到群聊
相关链接
- - OpenClaw Telegram 频道文档:~/.npm-global/lib/nodemodules/openclaw/docs/channels/telegram.md
- NOREPLY 模式:内置于 OpenClaw 网关中