rudometkin/genai-intensive/telegram-telethon
Claude Code and agent skill by rudometkin/genai-intensive
- community
Checking that the SKILL.md file is still in the repository.
Use when user wants to parse Telegram channels/chats, monitor messages live, send messages, fetch participants, or do anything else via Telegram MTProto user-API. Antiban defaults baked in (flood-wait handling, rate limits, human-like sleeps, realistic device params). Invoke for any Telegram automation, scraping, or bot-like-but-user-account task.
Install
npx vskill@latest install rudometkin/genai-intensive/telegram-telethonSKILL.md
The same SKILL.md was published earlier as rudometkin/genai-intensive/telegram-telethon.
telegram-telethon
User-API toolkit (Telethon, MTProto) with antiban defaults. One-time auth creates .session file, then reuse across tasks.
When to use
- Parse channel history (text, views, reactions, media)
- Live monitor channels with keywords
- Fetch chat participants
- Send messages / files / forwards as user
- Any MTProto task a bot can't do (read public channels, access full history, user-level actions)
When NOT to use
- Sending from a bot account → use Bot API (
aiogram/python-telegram-bot) - Business messenger features for customers → use official Telegram Bot Business API
Setup (one-time)
After auth, sessions/main.session exists. Reuse in all scripts.
Quick reference
| Task | Script | |
|---|---|---|
| First auth | python scripts/auth.py | |
| List your chats/channels | python scripts/get_dialogs.py | |
| Parse channel history | python scripts/parse_channel.py @chan --limit 1000 --db data.db | |
| Live monitor + keywords | python scripts/monitor.py @chan1 @chan2 --keywords "word1,word2" | |
| Send message | python scripts/send.py @user "hi" | |
| Send file | python scripts/send.py @user --file pic.jpg --caption "photo" | |
| Get participants (chats only) | python scripts/get_participants.py @chat --out members.csv |
All scripts load creds from secrets.env and session from sessions/main.session by default. Override: --session other or SESSION=other python ....
Antiban defaults (already set in lib/client.py + lib/antiban.py)
- Realistic
device_model,system_version,app_version,lang_code,system_lang_code(not Telethon defaults). - Global
RateLimiter(rps=1)— max 1 request/second across client. FloodWaitErrorauto-caught → sleepe.seconds + random(1..5)→ retry.human_sleep(min_s, max_s)between batches in scripts (1-3s default).- Single-account-per-session rule (never parallel same session).
- Warmup on first connect:
get_me()before heavy pulls. - Incremental parsing via
storage.get_last_id()— no full re-pulls. - No auto-join, no auto-follow, no mass-send helpers on purpose.
- Proxy support: set
PROXY=socks5://user:pass@host:portinsecrets.env.
Common tasks — code patterns
Parse channel incrementally
Live monitor with keywords
Send with retries
Extending — adding new task
- Add script to
scripts/, importlib.client.get_client,lib.antiban.*. - Wrap every Telethon API call with
safe_call(...)or useiter_*(already batched). - Sleep between heavy loops with
human_sleep(). - Persist state (last id, cursor) to sqlite so restart doesn't re-pull.
- Never spawn multiple clients on same session file.
Scaling to many accounts (later)
- One
.sessionper account insessions/. - Separate worker process per session (no async-share).
- Orchestrate via queue (RabbitMQ/Redis) + per-account rate limits.
- Rotate proxies per account, one proxy per account, never mix.
Red flags
- Parsing >10k messages in a burst without sleeps → flood ban.
- Joining many channels rapidly → phone-number lock.
- Using same session from two processes → desync/disconnect.
- Sending identical text to many users → spam flag.
- Running without
safe_call→ unhandledFloodWaitErrorkills script.
Troubleshooting
| Error | Fix | |
|---|---|---|
FloodWaitError: wait N seconds | Handled by safe_call. If raw: await asyncio.sleep(N + 2). | |
PhoneNumberBannedError | Account dead. New number. | |
SessionPasswordNeededError | 2FA on account → client.start(password='...'). | |
AuthKeyDuplicatedError | Two processes on one session. Kill one, re-auth. | |
ChannelPrivateError | Not a member / kicked. Join first or skip. | |
UsernameNotOccupiedError | Wrong @handle. |
File layout
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingprojects/KaymakanMaxim/PERSONAL/skills/telegram-telethon/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rudometkin/genai-intensive/telegram-telethon)