Sends files, photos, videos, voice notes, and documents to Telegram chats via personal account. Handles captions with HTML formatting, session auth, and link formatting rules.
Ships in tlg. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Send files, photos, videos, voice notes, and documents from your personal Telegram account.
Caption carries a session footer (project policy). A file send gets the same provenance footer as a text send appended to its caption (or used as the caption if none is given), for all recipients. Override the label with
--context, suppress with--no-footer. See send-message; logic inscripts/session-footer.ts.
Caption links are made exact (automatic). Each bare link in a caption gets an explicit link that ends where its URL ends, so it never swallows the Chinese text after it, and the command exits 1 if Telegram stored one that does. See send-message.
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
Linked text, not bare links (enforced). A caption whose visible text shows a
github.comURL or a bare#N/repo#Nis refused unless--show-urlis given; with--html, write<a href="https://github.com/example/repo/issues/36">Title (#36)</a>. See send-message.
Check session is authorized (not just that the file exists):
bun "$SCRIPT" check-auth
If EXPIRED, run /tlg:setup first (uses 3-step non-interactive auth pattern).
/usr/bin/env bash << 'EOF'
ROOT="$(cc-plugin-root tlg)"
SCRIPT="$ROOT/scripts/tg-cli.ts"
# Send a photo/image (auto-detected)
bun "$SCRIPT" send-file @username /path/to/photo.jpg
# Send with caption (plain text)
bun "$SCRIPT" send-file -1003958083153 /path/to/image.png -c "Check this out"
# HTML caption with linked text
bun "$SCRIPT" send-file @username /path/to/chart.png --html -c '<b>Chart</b> for <a href="https://github.com/example/repo/issues/36">报表口径 (#36)</a>'
# Force send as document (no preview)
bun "$SCRIPT" send-file @username /path/to/image.png --document
# Send voice note
bun "$SCRIPT" send-file -1003958083153 /path/to/audio.ogg --voice
# Send round video
bun "$SCRIPT" send-file @username /path/to/video.mp4 --video-note
EOF
Formatted captions: pass --html (bold, code, links). The caption limit (1024, or 4096 with Premium) counts the visible text, not the tags.
| Parameter | Type | Description |
|---|---|---|
| recipient | string/int | Username, phone, or chat ID |
| file | path | Local file path |
-c/--caption | string | Caption text (HTML with --html) |
--html | flag | Parse the caption as Telegram HTML |
--show-url | flag | Allow a bare GitHub URL or #N |
--voice | flag | Send as voice note |
--video-note | flag | Send as round video |
--document | flag | Force document (no media preview) |
GramJS auto-detects media type by extension. Override with flags.
| Type | Extensions | Notes |
|---|---|---|
| Photo | jpg, png, webp | Compressed by Telegram |
| Video | mp4, mov, avi | Use --document to skip compression |
| Audio | mp3, m4a, flac | Sent as audio player |
| Voice | ogg (opus) | Requires --voice flag |
| Document | pdf, zip, md, any | Sent as file attachment |
| Anti-Pattern | Why It Fails |
|---|---|
Running bun "$SCRIPT" without checking auth first | If session expired, auth will fail |
Using HTML in -c caption without --html | The tags show literally — pass --html |
| Checking only session file existence in preflight | Session file can exist but be expired — must check with check-auth |
After this skill completes, check before closing:
Only update if the issue is real and reproducible — not speculative.
What SKILL.md sets; muted values are Claude Code's defaults
/tlg:send-mediafrom tlg
npx claudepluginhub terrylica/cc-skills --plugin tlg16 skills in this plugin
/cleanup-deleteduser wants to clean up Telegram by purging deleted or ghost accounts from their dialog list and contacts, or removing spam ghosts that clutter./create-groupUse when user wants to create a new Telegram group, supergroup, or channel, optionally inviting members on creation./delete-messagesUse when user wants to delete, remove, or unsend Telegram messages from a chat, either for everyone or just for themselves./download-mediaUse when user wants to download, save, or extract media files such as photos, videos, and documents from Telegram messages.Other plugins' skills for the same job