Claude
Skills
Sign in
Back

agent-telegram

Included with Lifetime
$97 forever

Telegram CLI for AI agents. Use when the user needs to interact with Telegram — read messages, send messages, search chats, download media, monitor conversations, or automate any Telegram task. Triggers on requests to "check my messages", "send a message", "search Telegram", "read unread", "listen to chat", "download from Telegram", or any task requiring programmatic Telegram interaction via the `agent-telegram` CLI.

AI Agents

What this skill does


# Telegram Automation with agent-telegram

Telegram CLI for AI agents. Interact with Telegram programmatically — read messages, send messages, search, download media, and more.

All output is JSON to stdout. Warnings go to stderr. Prefer `jq` over `python3` for JSON processing — it's faster and preserves Unicode.

## Setup

If `agent-telegram` is not installed, read [references/installation.md](references/installation.md) for platform-specific install instructions, authentication, and troubleshooting.

```bash
agent-telegram me   # Verify connection works
```

A background daemon auto-starts on first command and keeps the Telegram connection alive, making subsequent commands fast (~0.2s vs ~2-3s).

## Commands

```bash
# Identity
agent-telegram me                                    # Current user info
agent-telegram info <id|username|phone|link>         # Detailed info (entity, chat, shared groups)

# Chat Discovery (local by default — searches your chats, not global)
agent-telegram chats search "query"                      # Find in your chats (local + server-backed)
agent-telegram chats search "query" --global             # Also search public Telegram (network)
agent-telegram chats search "query" --type chat          # Direct chats only (1:1)
agent-telegram chats search "query" --type bot           # Bots only
agent-telegram chats search "query" --type channel       # Channels only
agent-telegram chats search "query" --type group         # Groups only
agent-telegram chats search "query" --limit 10           # Cap results
agent-telegram chats search "query" --archived           # Only archived chats (default: excludes archived)

# Chat Lists
agent-telegram chats list [--limit N] [--archived]       # List chats (paginated)
agent-telegram chats list --type user|group|channel      # Filter by chat type
agent-telegram chats list --unread                       # Only chats with unread messages
agent-telegram chats list --offset-date N                # Paginate (unix timestamp from nextOffset)
agent-telegram chats members <chat> [--limit N] [--query text] [--offset N]  # Group/channel members
agent-telegram chats members <chat> --type bot|admin|recent                   # Filter by participant type

# Messages
agent-telegram msg list <chat> [--limit N]               # Message history (paginated)
agent-telegram msg list <chat> --offset-id N             # Continue from message ID (pagination cursor)
agent-telegram msg list <chat> --min-id N                # Only messages newer than this ID (exclusive floor)
agent-telegram msg list <chat> --since N                 # Only messages after unix timestamp
agent-telegram msg list <chat> --query "keyword"         # Search in chat
agent-telegram msg list <chat> --from <user>             # Filter by sender
agent-telegram msg list <chat> --filter photo            # Filter: photo|video|document|url|voice|gif|music
agent-telegram msg list <chat> --auto-download           # Auto-download photos/stickers/voice
agent-telegram msg list <chat> --auto-transcribe         # Auto-transcribe voice/video notes (Premium)
agent-telegram msg get <chat> <msgId>                    # Single message by ID

# Message Search
agent-telegram msg search "query"                            # Cross-chat search (your chats only)
agent-telegram msg search "query" --type channel             # Only messages in channels
agent-telegram msg search "query" --type group               # Only messages in groups
agent-telegram msg search "query" --type private             # Only messages in private chats
agent-telegram msg search "query" --filter photo             # Filter: photo|video|document|url|voice|gif|music|media|videonote|mention|pinned
agent-telegram msg search "query" --since N                  # Messages after unix timestamp
agent-telegram msg search "query" --until N                  # Messages before unix timestamp
agent-telegram msg search "query" --chat <id>                # Search within a specific chat
agent-telegram msg search "query" --chat <id> --from <user>  # Filter by sender (per-chat only)
agent-telegram msg search "query" --context N                # Include N before + hit + N after in context array
agent-telegram msg search "query" --auto-download            # Auto-download photos/stickers/voice
agent-telegram msg search "query" --auto-transcribe          # Auto-transcribe voice/video notes (Premium)
agent-telegram msg search "query" --full                     # Disable 500-char text truncation
agent-telegram msg search "query" --archived                 # Search archived chats only (default: main list)

# Send & Edit (plain text by default — no implicit markdown parsing)
agent-telegram action send <chat> "text"                    # Send message (plain text)
agent-telegram action send <chat> "text" --reply-to 123     # Reply to message
agent-telegram action send <chat> "text" --html             # With HTML formatting
agent-telegram action send <chat> "text" --md               # With MarkdownV2
agent-telegram action send <chat> "text" --silent           # No notification
agent-telegram action send <chat> "text" --no-preview       # Disable link preview
echo "text" | agent-telegram action send <chat> --stdin     # Read text from stdin
agent-telegram action send <chat> --file /path/to/msg.txt   # Read text from file
agent-telegram action edit <chat> <msgId> "new text"        # Edit message (plain text)
agent-telegram action edit <chat> <msgId> "text" --html     # Edit with formatting
agent-telegram action edit <chat> <msgId> "text" --md       # Edit with MarkdownV2
echo "text" | agent-telegram action edit <chat> <msgId> --stdin  # Read text from stdin
agent-telegram action edit <chat> <msgId> --file /path/to/msg.txt  # Read text from file

# Actions
agent-telegram action delete <chat> <msgId> [msgId...] [--revoke]  # Delete (--revoke = for everyone)
agent-telegram action forward <from> <to> <msgId> [msgId...] [--silent]  # Forward messages
agent-telegram action pin <chat> <msgId> [--silent]         # Pin message
agent-telegram action unpin <chat> <msgId>                  # Unpin message
agent-telegram action unpin <chat> --all                    # Unpin all messages
agent-telegram action react <chat> <msgId> <emoji>          # Add reaction
agent-telegram action react <chat> <msgId> <emoji> --remove # Remove reaction
agent-telegram action react <chat> <msgId> <emoji> --big    # Big animation
agent-telegram action click <chat> <msgId> <button>         # Click inline keyboard button (index or text)

# Real-time
agent-telegram listen --type user                        # Stream all user chat events (NDJSON)
agent-telegram listen --chat 12345,-1001234567890        # Stream specific chats
agent-telegram listen --type group --exclude-chat 12345  # All groups except one
agent-telegram listen --type user --auto-download        # Auto-download photos/stickers/voice
agent-telegram listen --type user --incoming             # Only incoming messages
agent-telegram listen --event new_message,edit_message   # Custom event types

# Media
agent-telegram media download <chat> <msgId> [--output path]  # Download message media
agent-telegram media download --file-id <id> [--output path]  # Download by TDLib file ID
agent-telegram media transcribe <chat> <msgId>                 # Transcribe voice/video note (Premium)
agent-telegram media caption <chat> <msgId>                    # Image captioning (local Florence-2)

# Advanced
agent-telegram eval '<javascript>'                   # Run JS with connected client
agent-telegram eval --file script.js                 # Run JS from file
agent-telegram eval <<'EOF'                          # Run JS via heredoc (recommended)
<code>
EOF

# Daemon
agent-telegram daemon start                          # Start background daemon
agent-telegram daemon stop                           # Stop daemon
agent-telegram daemon status                         # Check if daemon is running
agent-telegram daemon log [--json]          
Files: 2
Size: 23.9 KB
Complexity: 45/100
Category: AI Agents

Related in AI Agents