pytdbot

A Python library for building asynchronous Telegram bots and user clients through TDLib, Telegram’s client library. It provides documentation searches for methods, types, updates, and helper functions.

In plain words
What is it for?
Use it to send messages, handle Telegram updates, inspect TDLib types, and look up the library’s available methods and helpers.
Why use it?
It reduces the need to guess Telegram API names and data structures when writing Python code for Telegram.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pytdbot/client/ai
Any agent
npx skills add pytdbot/client --skill ai
Clone the repo
git clone --depth 1 https://github.com/pytdbot/client

Made for: Claude Code, Codex.

Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,107 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.02107
Opus 5 $0.00020 $0.01053
Sonnet 5 $0.00008 $0.00421
Haiku 4.5 $0.00004 $0.00211

Measured 2d ago against content hash 5d195182cf53, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pytdbot 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 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (__init__.py, lookup.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

pytdbot/ai/SKILL.md · 216 lines

How it starts

The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pytdbot

Async TDLib wrapper for Telegram users/bots in Python. It is not the HTTP Bot API — use Pytdbot/TDLib names and types only.

python -m pytdbot.docs (use this for the API)

Before calling an unfamiliar method or building a type, run the docs CLI. It searches the installed library and prints parameters, types, and descriptions.

Command When to use Example
search <query> Find symbols by keyword python -m pytdbot.docs search "send photo"
function <name> Full TDLib method signature python -m pytdbot.docs function sendMessage
type <name> Fields of a TDLib type python -m pytdbot.docs type message
class <name> Abstract class → concrete types python -m pytdbot.docs class InputFile
update <name> Update payload shape python -m pytdbot.docs update updateNewMessage
helper [name] Pytdbot bound methods, Client helpers, utils python -m pytdbot.docs helper reply_text
helper -q <query> Search helpers only python -m pytdbot.docs helper -q escape
stats Counts / TDLib version python -m pytdbot.docs stats

Workflow: search → pick a name → function / type / class / helper for full detail.
Flags: --json for machine-readable output; search --kind function (or type, class, update, helper) to narrow results.
Also available as pytdbot-docs after install. Same commands either way.

Preference order

  1. Bound methods — message.reply_text, message.reply_photo, message.text, …
  2. Client helpers — sendTextMessage, sendPhoto, sendAlbum, parseText, …
  3. pytdbot.utils — formatting, callback data, escapes, …
  4. TDLib methods on ClientsendMessage, getChat, … (camelCase)

Read the full file on GitHub · 216 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 2d ago First seen · 216 lines · 40 tokens per session scan A 5d195182cf53

Subscribe to this mod's changes

pytdbot is a skill published in the GitHub repository pytdbot/client (135 stars, last pushed 5d ago), licensed MIT. It adds 40 tokens to every session and 2,107 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

Telegram Custom Emoji Mosaic

Use when the user wants an image posted to Telegram as a custom-emoji mosaic — an emoji "painting" for a channel post — or asks to turn a picture into custom emoji, build an emoji pack from an image, or make an emoji banner.

howdeploy/deploychan_mcp · 56 tokens

tg-user-skill

Read, search, and send Telegram messages from any AI agent via the @cyberdrk/tg CLI. Use when the user asks to check inbox, search chats, send a message, look up a contact, list group members, or download media (photos/videos/files) from accessible chats. Works with Claude Code, Cursor, Aider, OpenHands, and any agent…

Maatq1544/ai-agent-telegram-skill · 105 tokens

using-telegram-cli

Use when an agent needs to ensure the @will-17173/telegram-cli tg command is available or use it for Telegram accounts, chats, messages, contacts, folders, notifications, archives, listening, or group administration.

will-17173/telegram-cli · 52 tokens

publish

Prepare and publish @will-17173/telegram-cli releases. Use when the user gives a new version number or asks to prepare, tag, push, or npm publish a telegram-cli release, including updating changelog/version/docs/site/skills, recreating an existing git tag when requested, and publishing with NPMTOKEN from .env.

will-17173/telegram-cli · 70 tokens

using-mtcute

Use when working with mtcute, @mtcute/ packages, Telegram MTProto in TypeScript, TL types, Telegram API methods, or building Telegram bots/clients/userbots with mtcute. Trigger for tasks involving TelegramClient, Dispatcher, filters, raw TL API calls, mtcute storage, sessions, media/files, keyboards, parse modes, or…

will-17173/telegram-cli · 115 tokens

Release Notes Generation

Mandatory fast-mcp-telegram release workflow. Use when the user says release, merge and release, bump version, tag, gh release, PyPI publish, or Telegram version announcement.

alexeyleshchenko/fast-mcp-telegram · 41 tokens