telegram-groupchat-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, enable cross-bot communication, or configure group mention gating.

7 stars

Best use case

telegram-groupchat-setup is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using telegram-groupchat-setup should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/tg-groupchat-setup/SKILL.md --create-dirs "https://raw.githubusercontent.com/Demerzels-lab/elsamultiskillagent/main/public/skills/arekqq/tg-groupchat-setup/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/tg-groupchat-setup/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How telegram-groupchat-setup Compares

Feature / Agenttelegram-groupchat-setupStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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.

Related Skills

memory-setup

7
from Demerzels-lab/elsamultiskillagent

Enable and configure Moltbot/Clawdbot memory search for persistent context. Use when setting up memory, fixing "goldfish brain," or helping users configure memorySearch in their config. Covers MEMORY.md, daily logs, and vector search setup.

telegram-create-bot

7
from Demerzels-lab/elsamultiskillagent

Build and manage Telegram bots via the Telegram Bot API. Create bots, send messages, handle webhooks, manage groups and channels.

ab-test-setup

7
from Demerzels-lab/elsamultiskillagent

When the user wants to plan, design, or implement an A/B test or experiment.

apipick-telegram-phone-check

7
from Demerzels-lab/elsamultiskillagent

Check if a phone number is registered on Telegram using the apipick Telegram Checker API.

rho-telegram-alerts

7
from Demerzels-lab/elsamultiskillagent

Send formatted trading alerts, portfolio updates, and market signals via Telegram.

trail-nav-telegram

7
from Demerzels-lab/elsamultiskillagent

Offline-capable hiking route guidance via Telegram location messages (OpenClaw)

openclaw-setup

7
from Demerzels-lab/elsamultiskillagent

Set up a complete OpenClaw personal AI assistant from scratch using Claude Code. Walks through AWS provisioning, OpenClaw installation, Telegram bot creation, API configuration, Google Workspace integration, security hardening, and all power features. Give this to Claude Code and it handles the rest.

telegram-auto-topic

7
from Demerzels-lab/elsamultiskillagent

Add `/topic` to the start of any message in a Telegram forum group to auto-create a new topic from it. A title is generated automatically from the message content. Github: https://github.com/itstauq/telegram-auto-topic

setuporion-byimpa

7
from Demerzels-lab/elsamultiskillagent

Setup completo de VPS Ubuntu/Debian para produção com Docker Swarm, Traefik v3 (SSL/HTTPS automático), Portainer CE.

xmtp-cli-setup

7
from Demerzels-lab/elsamultiskillagent

Initialize the XMTP CLI and configure environment variables. Use when setting up or changing CLI config (init, .env, gateway, env).

minimax-to-telegram

7
from Demerzels-lab/elsamultiskillagent

Generate images, audio, video using MiniMax MCP and send to Telegram.

macos-screenshot-telegram

7
from Demerzels-lab/elsamultiskillagent

Take a screenshot on macOS and send it to Telegram.