šŸŽ Get the FREE AI Skills Starter Guide — Subscribe →
BytesAgainBytesAgain
šŸ¦€ ClawHub

Telegram Group Chat

by @zboxman

Manages Telegram group chat replies by responding to @mentions, questions, name calls, technical topics, or priority users while preventing spam and bot loops.

Versionv1.0.0
Downloads356
Installs1
TERMINAL
clawhub install telegram-group-chat

šŸ“– About This Skill


name: telegram-group-chat description: Smart group chat reply logic for Telegram. Use when managing Telegram group interactions to avoid spam while staying helpful. Triggers on: group message handling, Telegram bot configuration, reply policy setup, multi-bot group chats, @mention handling, avoiding bot loops.

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 2. 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") 4. Technical topics — You can help with: code, api, config, error, bug, deploy, bot, openclaw, telegram, webhook, token 5. 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) 2. Only emoji — No text content, just emoji 3. Too short — <3 Chinese characters OR <1 English word 4. Small talk — Without @: 早安/ę™šå®‰/åƒäŗ†å—/hello/hi/hey/good morning 5. Cooldown active — Same topic replied within 5 minutes

Implementation: NO_REPLY Mechanism

When skipping a reply, respond with ONLY:

NO_REPLY

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:

### šŸ’¬ Group Chat Reply Rules (Telegram: YOUR_GROUP_ID)

Respond when (any one):

  • @mentioned (must reply)
  • Message contains questions (? ? or 什么/ę€Žä¹ˆ/äøŗä»€ä¹ˆ/how/what/why)
  • Called by name: "YourName"
  • Technical topics (code, api, config, error, bug, bot, openclaw, telegram)
  • Messages from priority user USER_ID
  • Skip reply when (any one):

  • From other bots (from.is_bot == true)
  • Only emoji, no text
  • Too short (<3 Chinese chars or <1 English word)
  • Small talk without @ (早安/ę™šå®‰/åƒäŗ†å—/hello/hi)
  • Same topic replied within 5 minutes (cooldown)
  • Silent reply: When skipping, respond with ONLY NO_REPLY

    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 2. Avoid bot loops — Never reply to other bots' messages 3. Use @ for directed questions — "@BotA 和 @BotB ä½ ä»¬č§‰å¾—å‘¢ļ¼Ÿ" 4. 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: ~/.npm-global/lib/node_modules/openclaw/docs/channels/telegram.md
  • NO_REPLY pattern: Built into OpenClaw gateway