openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > Telegram Group Chat Setup

Configure a MoltBot agent to participate in a Telegram group chat. Automates adding the group to the allowlist, setting mention patterns, and configuring sender permissions — all via a single gateway config patch. Use when the user wants to set up their bot in a Telegram group…

通信与消息

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v1.0.0

统计:⭐ 0 · 1.5k · 0 current installs · 0 all-time installs

0

安装量(当前) 0

🛡 VirusTotal :可疑 · OpenClaw :良性

Package:arekqq/tg-groupchat-setup

安全扫描(ClawHub)

  • VirusTotal :可疑
  • OpenClaw :良性

OpenClaw 评估

The skill's requests and actions are consistent with its stated purpose (configuring a MoltBot Telegram gateway) — it reads the local MoltBot config to find the bot token, calls Telegram's getMe API, and patches the gateway config — nothing appears malicious, though there are a few small operational/security notes to consider.

目的

The skill's name/description match what it actually does: detect bot identity, build mention patterns, and patch the gateway config. Reading the gateway config to find a Telegram bot token and calling api.telegram.org/getMe is expected for auto-detection.

说明范围

SKILL.md instructs reading the gateway config and calling Telegram's API (expected). However the runtime instructions and included script assume availability of curl and python3 even though required binaries were not declared. The script reads a local config file (CLAWDBOT_CONFIG_PATH or $HOME/.clawdbot/moltbot.json) and uses that token — this is necessary for the task but is sensitive behavior and should be documented to the user.

安装机制

Instruction-only skill with a small helper script; there is no download or installation step and no remote install URLs. This is low-risk from an install perspective.

证书

The skill reads a Telegram bot token from the local MoltBot config file — this is proportionate to its purpose. It does not request unrelated credentials or environment variables. Caveat: the script will embed the token into an HTTP URL passed to curl, which can expose the token to other local users via the process list; the skill also implicitly relies on CLAWDBOT_CONFIG_PATH behavior which is not documented in SKILL.md.

持久

always:false and no special persistence is requested. The skill patches the gateway config (expected for this purpose) but does not attempt to modify other skills or system-wide settings outside the gateway config.

综合结论

This skill appears to do what it claims, but review these points before installing or running it: 1) It reads your MoltBot config (default $HOME/.clawdbot/moltbot.json or CLAWDBOT_CONFIG_PATH) to extract the Telegram bot token — ensure you trust the skill and back up your config. 2) The included script uses curl and python3 even though the skill metadata doesn't list required binaries; make sure those tools are available and run the script und…

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Telegram Group Chat Setup」。简介:Configure a MoltBot agent to participate in a Telegram group chat. Automates ad…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/arekqq/tg-groupchat-setup/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: telegram-groupchat-setup
description: >
  Configure a MoltBot agent to participate in a Telegram group chat.
  Automates adding the group to the allowlist, setting mention patterns,
  and configuring sender permissions — all via a single gateway config patch.
  Use when the user wants to set up their bot in a Telegram group,
  enable cross-bot communication, or configure group mention gating.

---

# Telegram Group Chat Setup

Automate the configuration needed for a MoltBot agent to work in a Telegram group.

## What this skill does

1. Adds a Telegram group to the gateway allowlist with `requireMention: true`
2. Configures `groupAllowFrom` with specified user IDs / @usernames
3. Auto-detects the bot's name and @username via the Telegram Bot API
4. Sets `mentionPatterns` so the bot responds to its name and @username
5. Applies the config patch and restarts the gateway

## Prerequisites (manual steps)

Before running this skill, the user must:

1. **Create the Telegram group** and **add the bot** to it
2. **Disable privacy mode** in @BotFather:
   `/mybots` → select bot → Bot Settings → Group Privacy → Turn off
   (See `references/telegram-privacy-mode.md` for details)
3. Know the **group ID** (negative number for Telegram groups)
4. Know the **user IDs or @usernames** of people allowed to trigger the bot

## Usage

The user provides:
- `group_id`: Telegram group ID (e.g., `-1001234567890`)
- `allowed_users`: List of Telegram user IDs or @usernames who can trigger the bot

Example prompt:
> "Set up my bot in Telegram group -1001234567890. Allow users 123456789 and @some_user to ping me."

## Implementation Steps

### Step 1: Detect bot info

Run the detection script to get the bot's name and username:

```bash
bash skills/groupchat-setup/scripts/detect_bot_info.sh
```

This reads the bot token from the gateway config and returns the bot's `name` and `username`.
If the script is unavailable, extract the bot token from `channels.telegram.botToken` in the
gateway config and call `https://api.telegram.org/bot<TOKEN>/getMe`.

### Step 2: Build mention patterns

From the detected bot info, construct mention patterns:
- `@<username>` (e.g., `@my_awesome_bot`)
- `<name>` lowercase (e.g., `mybot`)
- `@<name>` lowercase (e.g., `@mybot`)

Remove duplicates. Patterns are case-insensitive regexes.

### Step 3: Apply config patch

Use the `gateway` tool with `action: "config.patch"` to apply:

```json
{
  "channels": {
    "telegram": {
      "groups": {
        "<group_id>": {
          "requireMention": true
        }
      },
      "groupAllowFrom": ["<user1>", "<user2>"]
    }
  },
  "messages": {
    "groupChat": {
      "mentionPatterns": ["@bot_username", "bot_name", "@bot_name"]
    }
  }
}
```

**Important:** If `groupAllowFrom` or `mentionPatterns` already have values, merge them
(do not overwrite). Read the current config first with `gateway action: "config.get"`,
merge arrays, then patch.

### Step 4: Confirm

After the gateway restarts, send a test message to the group confirming the setup:

> "✅ Bot configured for this group! I'll respond when someone mentions my name. Allowed users: [list]."

## Notes

- `requireMention: true` means the bot only responds when explicitly mentioned — it won't spam every message.
- `groupAllowFrom` restricts which senders can trigger the bot. Without it, messages from unknown senders may be dropped.
- `groupPolicy: "allowlist"` is the Telegram default — only explicitly listed groups are active.
- Privacy mode is a Telegram-side setting that cannot be changed via API. The user must do this in @BotFather.
- For multi-bot groups (e.g., two MoltBot agents), each bot must run this setup independently on its own gateway.