0xx9/telegram-agent-kit/telethon-patterns
Claude Code and agent skill by 0xx9/telegram-agent-kit
- community
Checking that the SKILL.md file is still in the repository.
Safe Telethon userbot patterns: sessions, flood wait, events, disconnect handling, and Bot API separation. Use when building MTProto clients or migrating from Pyrogram/Telethon legacy code.
Install
npx vskill@latest install 0xx9/telegram-agent-kit/telethon-patternsSKILL.md
The same SKILL.md was published earlier as 0xx9/telegram-agent-kit/telethon-patterns.
Telethon Patterns
Telethon uses MTProto (user/client API), not BotFather tokens.
Client setup
Never commit bot_session.session or export session strings to git.
Main loop
Event handlers
Use incoming=True explicitly. Filter early to reduce load.
Flood wait (mandatory)
Never spin-tight retry on flood errors.
Join requests / channels
- Bot API handles
chat_join_request— prefer Bot API for channel join flows when possible - Userbots for actions bots cannot do — document ToS implications
Disconnect & reconnect
Handle KeyboardInterrupt with await client.disconnect().
Bot vs userbot separation
| Task | Use | |
|---|---|---|
| Inline buttons in channels | Bot API | |
| Read all group history as user | Telethon (careful) | |
| Approve join requests | Bot API with admin rights |
Do not run Bot token client and userbot in one codebase without clear module boundaries.
Anti-patterns
- Sharing one session file across multiple servers (session conflicts)
client.start(phone=...)in production without interactive login solved first- Ignoring
UserDeactivatedBanErrorand retrying forever - Scraping at high volume without delays
Security
- Session string = full account — rotate if leaked
- Use dedicated account, not personal daily driver
- 2FA enabled on Telegram account
Security
- Security scanPassed, 95 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 repositoryCheckingskills/telethon-patterns/SKILL.md
Popularity
- 7-day trend score
- 5
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/0xx9/telegram-agent-kit/telethon-patterns)