Borrowing it
Nothing to install: this file belongs to alexeyleshchenko/fast-mcp-telegram. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/alexeyleshchenko/fast-mcp-telegram/master/.cursor/skills/telegram-patterns/SKILL.mdgit clone --depth 1 https://github.com/alexeyleshchenko/fast-mcp-telegramWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/alexeyleshchenko/fast-mcp-telegram/telegram-patterns)<a href="https://agentmods.dev/skills/alexeyleshchenko/fast-mcp-telegram/telegram-patterns"><img src="https://agentmods.dev/badge/skills/alexeyleshchenko/fast-mcp-telegram/telegram-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/alexeyleshchenko/fast-mcp-telegram/telegram-patterns"><img src="https://agentmods.dev/badge/skills/alexeyleshchenko/fast-mcp-telegram/telegram-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00012 | $0.00886 |
| Opus 5 | $0.00006 | $0.00443 |
| Sonnet 5 | $0.00002 | $0.00177 |
| Haiku 4.5 | $0.00001 | $0.00089 |
Grade A, and why
telegram-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to telegram-patterns — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 153 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Telegram-Specific Patterns
Entity Resolution
Always resolve chat/user entities using the utility functions:
from src.utils.entity import get_entity_by_id
# ✅ Correct - handles all entity types (users, chats, channels)
entity = await get_entity_by_id(chat_id)
if not entity:
raise ValueError(f"Could not find chat with ID '{chat_id}'")
# ❌ Wrong - don't use client.get_entity directly
entity = await client.get_entity(chat_id) # Missing error handling
Special Chat Identifiers
Use these special identifiers for common chats:
# Saved Messages (your own messages)
chat_id = "me"
# Channel IDs (always start with -100)
channel_id = "-1001234567890"
# User IDs (numeric strings)
user_id = "123456789"
# Usernames (without @)
username = "telegram"
Message Content Detection
Check for various types of message content:
# Check for text content
has_text = message.text and message.text.strip()
# Check for media content (photos, documents, etc.)
has_media = hasattr(message, "media") and message.media is not None
# Check for specific media types
is_photo = hasattr(message, "photo") and message.photo is not None
is_document = hasattr(message, "document") and message.document is not None
is_voice = hasattr(message, "voice") and message.voice is not None
Message Iteration
Use proper patterns for iterating through messages:
# ✅ Correct - limit results and handle empty messages
async for message in client.iter_messages(entity, limit=50):
if not message:
continue
# Process message
await process_message(message)
# ❌ Wrong - no limit can cause performance issues
async for message in client.iter_messages(entity): # No limit!
pass
Forwarded Message Handling
Handle forwarded messages properly:
# Check if message is forwarded
if hasattr(message, "forward") and message.forward:
forward_info = await _extract_forward_info(message)
original_sender = forward_info.get("sender")
original_chat = forward_info.get("chat")
forward_date = forward_info.get("date")
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 153 lines · 12 tokens per session scan A 0173f6e04a12
telegram-patterns is a skill published in the GitHub repository alexeyleshchenko/fast-mcp-telegram (2 stars, last pushed 19d ago), licensed MIT. It adds 12 tokens to every session and 886 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to telegram-patterns, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
pytdbot
Write Telegram bots and userbots with Pytdbot (async TDLib wrapper with high-level helpers; not the Telegram Bot API). Use when the user works with Pytdbot, TDLib, or pytdbot.Client.
gkmex-api-integration
Use when building or troubleshooting an application that consumes Gkmex's public crane inventory through REST, the official JavaScript SDK, or the Python SDK.
python-development
Professional Python development skill covering modern Python 3.10+, FastAPI, Django, Flask, async programming, data processing, and best practices. Use this skill when developing Python web applications, building FastAPI/Django projects, implementing async programming, or need guidance on Python architecture design…
stripe-projects
Use after E2B sandbox/API access has been provisioned through Stripe Projects and the user needs to use the resulting E2B API key with the E2B CLI, JavaScript SDK, Python SDK, or Code Interpreter SDK.
azure-messaging-webpubsubservice-py
Azure Web PubSub Service SDK for Python. Use for real-time messaging, WebSocket connections, and pub/sub patterns. Triggers: "azure-messaging-webpubsubservice", "WebPubSubServiceClient", "real-time", "WebSocket", "pub/sub".
azure-mgmt-botservice-py
Azure Bot Service Management SDK for Python. Use for creating, managing, and configuring Azure Bot Service resources. Triggers: "azure-mgmt-botservice", "AzureBotService", "bot management", "conversational AI", "bot channels".