home / skills / lycfyi / community-agent-plugin / telegram-list

This skill lists accessible Telegram groups, channels, and DMs, and shows forum topics when available.

npx playbooks add skill lycfyi/community-agent-plugin --skill telegram-list

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
2.5 KB
---
name: telegram-list
description: "List Telegram groups and channels. Use when user asks about available groups, channels, or wants to discover what's accessible."
---

# telegram-list

List Telegram groups, channels, DMs, and forum topics.

## Trigger Phrases

- "list Telegram groups"
- "what groups do I have on Telegram"
- "show my Telegram channels"
- "telegram list"
- "list topics in [group]"
- "list my Telegram DMs"

## Description

This skill lists all accessible Telegram groups, channels, and DMs. DMs are included by default. For groups with forum topics enabled, you can also list the individual topics.

## Usage

List all groups and DMs (default):
```bash
python ${CLAUDE_PLUGIN_ROOT}/tools/telegram_list.py
```

List groups only (exclude DMs):
```bash
python ${CLAUDE_PLUGIN_ROOT}/tools/telegram_list.py --no-dms
```

List topics in a specific group:
```bash
python ${CLAUDE_PLUGIN_ROOT}/tools/telegram_list.py --group 1234567890
```

Output as JSON:
```bash
python ${CLAUDE_PLUGIN_ROOT}/tools/telegram_list.py --json
```

## Output Format

### Table Output (default)

```
Found 5 groups/channels:

ID              Type         Members    Topics   Name
----------------------------------------------------------------------
1234567890      supergroup   1500       Yes      My Community
9876543210      channel      5000       -        News Channel
...

Found 3 DMs:

ID              Type         Username             Name
------------------------------------------------------------
111222333       private      @alice               Alice Smith
444555666       private      -                    Bob Jones
...
```

### JSON Output (--json)

```json
[
  {
    "id": 1234567890,
    "name": "My Community",
    "type": "supergroup",
    "username": "mycommunity",
    "member_count": 1500,
    "has_topics": true
  }
]
```

## Group Types

- `private` - 1:1 private chats
- `group` - Basic groups (< 200 members)
- `supergroup` - Upgraded groups (can have topics)
- `channel` - Broadcast channels

## Forum Topics

Some supergroups have "forum topics" enabled, which is similar to Discord's channel structure. When a group has topics:
- Messages are organized by topic
- Use `--group GROUP_ID` to see available topics
- Sync will pull messages from each topic separately

## Exit Codes

- `0` - Success
- `1` - Authentication error
- `2` - Group not found or configuration error

## Related Skills

- `telegram-init` - Initialize Telegram connection
- `telegram-sync` - Sync messages from groups
- `telegram-read` - Read synced messages

Overview

This skill lists Telegram groups, channels, direct messages, and forum topics that the connected account can access. It helps quickly discover and inspect available Telegram conversations and their basic metadata. Use it to get an inventory before syncing or analyzing messages.

How this skill works

The skill queries the Telegram account and returns a catalog of chats: private DMs, groups, supergroups, and channels. For supergroups with forum topics enabled, it can list individual topics for that group. Output can be shown in a human-readable table or exported as JSON for automation.

When to use it

  • You want an inventory of all Telegram conversations accessible to the bot/account.
  • Preparing to sync messages and need the target group or topic IDs.
  • Checking which groups support forum topics before running a topic-level sync.
  • Exporting chat metadata for audits or integration with other tools.
  • Verifying connection/authentication to Telegram before other operations.

Best practices

  • Run the skill after completing Telegram initialization to ensure proper credentials.
  • Use JSON output when integrating with downstream scripts or CI pipelines.
  • Filter to a specific group ID when you only need topic listings to reduce noise.
  • Exclude DMs (--no-dms) when you only care about community channels and groups.
  • Handle exit codes: 1 indicates auth issues, 2 means group not found or misconfiguration.

Example use cases

  • List all channels and groups to pick targets for a message sync job.
  • Export chat IDs and member counts as JSON for a management dashboard.
  • Inspect a supergroup to enumerate forum topics before bulk message collection.
  • Confirm which DMs are visible to the bot during troubleshooting.
  • Generate a quick report of channels and member counts for community analytics.

FAQ

Can I list topics for a specific group only?

Yes. Use the group ID option to list forum topics for a supergroup that has topics enabled.

What output formats are available?

The skill prints a readable table by default and supports JSON output for automation and integrations.