send-media
Use when user wants to send or upload a file, photo, video, voice note, or document on Telegram via their personal account.
What this skill does
# Send Media on Telegram
Send files, photos, videos, voice notes, and documents from your personal Telegram account.
> **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.
## Preflight
Check session is **authorized** (not just that the file exists):
```bash
VIRTUAL_ENV="" uv run --python 3.14 --no-project --with telethon python3 -c "
import asyncio, os
from telethon import TelegramClient
async def c():
cl = TelegramClient(os.path.expanduser('~/.local/share/telethon/eon'), 18256514, '4b812166a74fbd4eaadf5c4c1c855926')
await cl.connect()
print('OK' if await cl.is_user_authorized() else 'EXPIRED')
await cl.disconnect()
asyncio.run(c())
"
```
If `EXPIRED`, run `/tlg:setup` first (uses 3-step non-interactive auth pattern).
## Usage: tg-cli.py (simple cases)
```bash
/usr/bin/env bash << 'EOF'
SCRIPT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/marketplaces/cc-skills/plugins/tlg}/scripts/tg-cli.py"
# Send a photo/image (auto-detected)
uv run --python 3.14 "$SCRIPT" send-file @username /path/to/photo.jpg
# Send with caption
uv run --python 3.14 "$SCRIPT" send-file -1003958083153 /path/to/image.png -c "Check this out"
# Force send as document (no preview)
uv run --python 3.14 "$SCRIPT" send-file @username /path/to/image.png --document
EOF
```
## Usage: Direct Telethon (preferred for HTML captions and multi-file sends)
When you need HTML-formatted captions or need to send multiple files in sequence, bypass `tg-cli.py` and use Telethon directly. This pattern was proven reliable:
```bash
VIRTUAL_ENV="" uv run --python 3.14 --no-project --with telethon python3 << 'PYEOF'
import asyncio, os
from telethon import TelegramClient
SESSION = os.path.expanduser("~/.local/share/telethon/eon")
API_ID = 18256514
API_HASH = "4b812166a74fbd4eaadf5c4c1c855926"
CHAT_ID = -1003958083153 # negative for groups
CAPTION = """<b>File Title</b>
<pre>
- Item one
- Item two
- Item three
</pre>"""
async def send():
client = TelegramClient(SESSION, API_ID, API_HASH)
await client.connect()
# Single file with HTML caption
await client.send_file(CHAT_ID, "/path/to/file.md",
caption=CAPTION, parse_mode='html')
# Multiple files in sequence
files = ["/path/to/file1.md", "/path/to/file2.md"]
captions = ["<b>First file</b>", "<b>Second file</b>"]
for f, c in zip(files, captions):
await client.send_file(CHAT_ID, f, caption=c, parse_mode='html')
print("All files sent.")
await client.disconnect()
asyncio.run(send())
PYEOF
```
## Parameters (tg-cli.py)
| Parameter | Type | Description |
| -------------- | ---------- | -------------------------------------- |
| recipient | string/int | Username, phone, or chat ID |
| file | path | Local file path |
| `-c/--caption` | string | Caption text (plain text only via CLI) |
| `--voice` | flag | Send as voice note |
| `--video-note` | flag | Send as round video |
| `--document` | flag | Force document (no media preview) |
## Supported Formats
Telethon 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-Patterns (NEVER DO)
| Anti-Pattern | Why It Fails |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------- |
| Running `uv run` without `VIRTUAL_ENV=""` when using inline python | Broken `.venv` in cwd causes uv to fail even with `--no-project` |
| Using `tg-cli.py send-file` with HTML in `-c` caption | CLI caption is plain text — use direct Telethon for `parse_mode='html'` |
| Checking only session file existence in preflight | Session file can exist but be expired — must check `is_user_authorized()` |
## Post-Execution Reflection
After this skill completes, check before closing:
1. **Did the command succeed?** — If not, fix the instruction or error table that caused the failure.
2. **Did parameters or output change?** — If tg-cli.py's interface drifted, update Usage examples and Parameters table to match.
3. **Was a workaround needed?** — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.
Only update if the issue is real and reproducible — not speculative.
Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.