Generated banner for Telegram Reader
Generated logo for Telegram Reader

Telegram Reader

Alex YangCommunityCreated by Alex Yang

  • Skill
  • Tool integration
  • Automation and integrations
  • MIT
  • Medium risk

From the author

Read Telegram channels and groups for financial news and market research with the tdl CLI: list chats and channels, find a channel by name, and export recent messages or a date or ID range. Use this skill whenever the user wants to check their Telegram, see what's new in their channels, read or export messages from a news, crypto, or trading channel or group, or gather market news and signals posted on Telegram. Read-only: it cannot send messages or join or leave channels.
— the description by Alex Yang

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The telegram-reader skill enables AI agents to interface with Telegram channels and groups in a read-only capacity. By leveraging the tdl CLI tool, the agent can list available chats, search for specific channels, and export message history based on time, ID range, or recent activity. This skill is specifically optimized for financial and market research, allowing users to aggregate news, signals, and updates from multiple sources into a structured format for analysis.

What it does

  • Lists Telegram chats and channels associated with the authenticated account.
  • Searches for specific channels by name or keyword.
  • Exports message history including text content and metadata.
  • Supports filtering exports by time ranges, message ID ranges, or recent message counts.
  • Handles multi-account management through namespace support.
  • Provides read-only access to ensure user privacy and account security.

When to use it

  • When you need to gather financial news or market signals from Telegram channels.
  • When you want to archive or analyze historical message data from a specific group.
  • When you need to monitor multiple trading or crypto channels for updates.
  • When you need to extract specific information from a Telegram thread or topic.

Advantages

  • Enables automated data collection from Telegram for research purposes.
  • Supports structured JSON output for easy data processing.
  • Provides flexible filtering options to narrow down relevant information.
  • Maintains a secure, read-only posture for the connected account.

Usage examples

“List all my Telegram channels.”
The agent executes tdl chat ls -f "Type contains 'channel'" and presents a list of channels with their names and IDs.
“Get the last 50 messages from the @MarketNews channel.”
The agent runs tdl chat export -c @MarketNews -T last -i 50 --all --with-content and summarizes the latest news updates.
“Find the Bloomberg channel in my chat list.”
The agent uses tdl chat ls -f "VisibleName contains 'Bloomberg'" to locate and return the channel details.
“Export messages from the crypto group for the last 24 hours.”
The agent calculates the Unix timestamps for the last 24 hours and runs the export command to retrieve the relevant messages.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/himself65/telegram-reader/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip telegram-reader.zip -d .agents/skills

Documentation by Alex Yang

Telegram News Skill (Read-Only)

If your host has not already executed the shell probes below (for example, in Codex), run the commands inside the ! wrappers with its shell tool before choosing a setup path. Use the actual output; if shell access is unavailable, report that limitation.

Reads Telegram channels and groups for financial news and market research using tdl, a Telegram CLI tool.

This skill is read-only. It is designed for financial research: reading channel messages, monitoring financial news channels, and exporting message history. It does NOT support sending messages, joining/leaving channels, or any write operations.


Step 1: Ensure tdl Is Installed

Current environment status:

!`(command -v tdl && tdl version 2>&1 | head -3 || echo "TDL_NOT_INSTALLED") 2>/dev/null`

If the status above shows a version number, tdl is installed — skip to Step 2.

If TDL_NOT_INSTALLED, install tdl based on the user's platform:

PlatformInstall Command
macOS / Linuxcurl -sSL https://docs.iyear.me/tdl/install.sh | sudo bash
macOS (Homebrew)brew install telegram-downloader
Linux (Termux)pkg install tdl
Linux (AUR)yay -S tdl
Linux (Nix)nix-env -iA nixos.tdl
Go (any platform)go install github.com/iyear/tdl@latest

Default to Homebrew on macOS. On Linux the install script runs with sudo, so confirm with the user before using it, or offer their package manager instead.


Step 2: Ensure tdl Is Authenticated

Current auth status:

!`(tdl chat ls --limit 1 2>&1 >/dev/null && echo "AUTH_OK" || echo "AUTH_NEEDED") 2>/dev/null`

If AUTH_OK, skip to Step 3.

If AUTH_NEEDED, guide the user through login. Login requires interactive input — the user must enter their phone number and verification code manually.

Login methods

Method A: QR Code (recommended — fastest)

tdl login -T qr

A QR code will be displayed in the terminal. The user scans it with their Telegram mobile app (Settings > Devices > Link Desktop Device).

Method B: Phone + Code

tdl login -T code

The user enters their phone number, then the verification code sent to their Telegram app.

Method C: Import from Telegram Desktop

If the user has Telegram Desktop installed and logged in:

tdl login

This imports the session from the existing desktop client. The desktop client must be from the official website, NOT from the App Store or Microsoft Store.

Namespaces

By default, tdl uses a default namespace. To manage multiple accounts:

tdl login -n work -T qr      # Login to "work" namespace
tdl chat ls -n work           # Use "work" namespace for commands
Important login notes
  • Login is a one-time operation. The session persists on disk after successful login.

  • If login fails, ask the user to check their internet connection and try again.

  • Never ask for or handle Telegram passwords/2FA codes programmatically — always let the user enter them interactively.


Step 3: Identify What the User Needs

Match the user's request to one of the read operations below.

User RequestCommandKey Flags
List all chats/channelstdl chat ls-o json, -f "FILTER"
List only channelstdl chat ls -f "Type contains 'channel'"-o json
Export recent messagestdl chat export -c CHAT -T last -i N--all, --with-content
Export messages by time rangetdl chat export -c CHAT -T time -i START,END--all, --with-content
Export messages by ID rangetdl chat export -c CHAT -T id -i FROM,TO--all, --with-content
Export from a topic/threadtdl chat export -c CHAT --topic TOPIC_ID--all, --with-content
Search for a channel by nametdl chat ls -f "VisibleName contains 'NAME'"-o json
Chat identifiers

The -c flag accepts multiple formats:

FormatExample
Username (with @)-c @channel_name
Username (without @)-c channel_name
Numeric chat ID-c 123456789
Public link-c https://t.me/channel_name
Phone number-c "+1 123456789"
Saved Messages-c "" (empty)

Step 4: Execute the Command

Listing chats
# List all chats
tdl chat ls

# JSON output for processing
tdl chat ls -o json

# Filter for channels only
tdl chat ls -f "Type contains 'channel'"

# Search by name
tdl chat ls -f "VisibleName contains 'Bloomberg'"
Exporting messages

Always use --all --with-content to get text messages (not just media):

# Last 20 messages from a channel
tdl chat export -c @channel_name -T last -i 20 --all --with-content -o /tmp/tdl-export.json

# Messages from a time range (Unix timestamps)
tdl chat export -c @channel_name -T time -i 1710288000,1710374400 --all --with-content -o /tmp/tdl-export.json

# Messages by ID range
tdl chat export -c @channel_name -T id -i 100,200 --all --with-content -o /tmp/tdl-export.json
Key rules
  1. Check auth first — run tdl chat ls --limit 1 before other commands to verify the session is valid

  2. Always use --all --with-content when exporting messages for reading — without these flags, tdl only exports media messages

  3. Use -o FILE to save exports to a file, then read the JSON — this is more reliable than parsing stdout

  4. Start with small exports — use -T last -i 20 unless the user asks for more

  5. Use filters on chat ls to help users find the right channel before exporting

  6. Read-only — don't send messages, join or leave channels, or modify anything

  7. Convert timestamps — when the user gives dates, convert to Unix timestamps for the -T time filter

Working with exported JSON

After exporting, read the JSON file and extract the relevant information:

# Export messages
tdl chat export -c @channel_name -T last -i 20 --all --with-content -o /tmp/tdl-export.json

# Read and process the export
cat /tmp/tdl-export.json

The export JSON contains message objects with fields like id, date, message (text content), from_id, views, and media metadata.


Step 5: Present the Results

Lead with the most relevant news or market updates rather than a raw dump. Give each message its timestamp and source channel, group messages from several channels by theme (macro, earnings, crypto), and call out breaking news, price targets, and earnings surprises. For channel lists, show name, member count, and type.


Step 6: Diagnostics

If something isn't working:

ErrorCauseFix
not authorized or session errorsNot logged in or session expiredRun tdl login -T qr to re-authenticate
FLOOD_WAIT_XRate limited by TelegramWait X seconds, then retry
CHANNEL_PRIVATENo access to channelUser must join the channel in their Telegram app first
tdl: command not foundtdl not installedInstall using Step 1

Reference Files

  • references/commands.md — Complete tdl command reference for reading channels and exporting messages

Read the reference file when you need exact command syntax or detailed flag documentation.

Files

references/commands.md

tdl Command Reference (Read-Only)

Complete reference for tdl commands used in the telegram skill. Only read operations are documented — this skill does not support write operations.

Global Flags

FlagDescription
-n NAMESPACEUse a specific namespace (default: default)
--proxy PROXYSet proxy (e.g., socks5://127.0.0.1:1080, http://127.0.0.1:7890)

Login

tdl login -T qr

Displays a QR code in the terminal. Scan with Telegram mobile app (Settings > Devices > Link Desktop Device).

Phone + Code Login
tdl login -T code

Enter phone number and verification code interactively.

Desktop Client Import
tdl login

Imports session from Telegram Desktop. Client must be from official website, not App Store or Microsoft Store.

Optional flags:

FlagDescription
-T TYPELogin type: qr, code, or desktop import (default)
-n NAMESPACELogin to a specific namespace
-p PASSCODEPasscode for desktop client (if set)
-d PATHCustom path to desktop client data

List Chats

tdl chat ls [flags]
FlagDescription
-o jsonOutput as JSON
-f "FILTER"Filter expression
Filter examples
# All channels
tdl chat ls -f "Type contains 'channel'"

# Search by name
tdl chat ls -f "VisibleName contains 'Bloomberg'"

# Channels with specific name
tdl chat ls -f "Type contains 'channel' && VisibleName contains 'Finance'"

# Groups with topics
tdl chat ls -f "len(Topics)>0"

# List available filter fields
tdl chat ls -f -

Export Messages

tdl chat export -c CHAT [flags]
Chat identifier formats
FormatExample
Username (with @)-c @channel_name
Username (without @)-c channel_name
Numeric chat ID-c 123456789
Public link-c https://t.me/channel_name
Phone number-c "+1 123456789"
Saved Messages-c ""
Range selection
Type FlagInput FlagDescriptionExample
-T last-i NLast N messages-T last -i 50
-T time-i START,ENDUnix timestamp range-T time -i 1710288000,1710374400
-T id-i FROM,TOMessage ID range-T id -i 100,500
Content flags
FlagDescription
--allInclude all messages, not just media messages
--with-contentInclude message text content
--rawOutput raw MTProto structure
-o FILEOutput file path (default: tdl-export.json)
Topic / Reply flags
FlagDescription
--topic TOPIC_IDExport from a specific forum topic
--reply POST_IDExport replies to a specific post
Filtering messages
# List available filter fields
tdl chat export -c CHAT -f -

# Filter by views
tdl chat export -c CHAT -T last -i 50 -f "Views>200"

# Filter by media
tdl chat export -c CHAT -T last -i 50 -f "Media.Name endsWith '.pdf'"
Complete export examples
# Last 20 messages with text content from a channel
tdl chat export -c @WallStreetBets -T last -i 20 --all --with-content -o /tmp/wsb.json

# Messages from the last 24 hours (adjust timestamps)
tdl chat export -c @MarketNews -T time -i $(date -d '24 hours ago' +%s),$(date +%s) --all --with-content -o /tmp/market.json

# macOS timestamp variant
tdl chat export -c @MarketNews -T time -i $(date -v-24H +%s),$(date +%s) --all --with-content -o /tmp/market.json

# Export from a topic in a group
tdl chat export -c @CryptoGroup --topic 42 -T last -i 30 --all --with-content -o /tmp/crypto.json

Useful Patterns

Read latest news from multiple channels
# Export from each channel
for channel in "@Channel1" "@Channel2" "@Channel3"; do
  tdl chat export -c "$channel" -T last -i 10 --all --with-content -o "/tmp/tdl-${channel#@}.json"
done
Find a channel then read it
# Step 1: Find the channel
tdl chat ls -f "VisibleName contains 'crypto'" -o json

# Step 2: Export messages (use the ID or username from step 1)
tdl chat export -c @found_channel -T last -i 20 --all --with-content -o /tmp/export.json
Unix timestamp helpers
# macOS: 24 hours ago
date -v-24H +%s

# macOS: 7 days ago
date -v-7d +%s

# macOS: specific date
date -j -f "%Y-%m-%d" "2026-03-01" +%s

# Linux: 24 hours ago
date -d '24 hours ago' +%s

# Linux: specific date
date -d '2026-03-01' +%s

# Current time
date +%s

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs network access

Security

What our scanner noticed· Medium risk

  • Instructions that use the network
  • Downloads piped into a shell

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Alex Yang
Publisher
Alex Yang (Community)
Source
himself65/finance-skills · plugins/social-readers/skills/telegram-reader · commit a085078
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Alex Yang or Alex Yang.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download telegram-reader.zip