agentleFS
talyuktalyuk/telegram-bot-api-skill/skills/telegram-bot-api/SKILL.md

telegram-bot-api

Skill0 starsChanged 24 days agoMITView on GitHub

Use when writing or debugging anything against the Telegram Bot API or Telegram Mini Apps — bot handlers, webhooks vs getUpdates, sendMessage/sendPhoto/sendMediaGroup, inline keyboards and callback_data, parse_mode escaping, initData validation, Telegram Stars and payments, 429 flood control, blocked-user errors, or aiogram/python-telegram-bot/grammY/telegraf code. Also use when asked which Bot API version introduced a field or method.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. littlebearapps/untether★ 72same name
    2. puregram/skills★ 3same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every row below was answered wrongly by a competent agent working from memory.

    line 36
  2. Very specific:

    Stop and run tg-api.py show instead:

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Telegram Bot API

Snapshot: Bot API 10.3, released 2026-08-24. 185 methods, 400 types.

Look it up; do not recall it

The Bot API ships roughly monthly and most of its surface postdates any model's training cutoff. Recalled limits are wrong often enough to cost a production incident, and they are wrong confidently — the numbers feel precise.

A lookup costs one command (paths are relative to this skill's directory — ~/.claude/skills/telegram-bot-api/):

scripts/tg-api.py show sendPhoto       # real parameter table, with types and required flags
scripts/tg-api.py search clipboard     # find the method or type by name or summary
scripts/tg-api.py fields Message       # field names only
scripts/tg-api.py since 10.0           # changelog bullets at or after a version
scripts/tg-api.py version              # snapshot vs live — says if the snapshot is stale
scripts/tg-api.py refresh              # re-fetch core.telegram.org, rewrite spec.json

spec.json is parsed from core.telegram.org/bots/api itself, so show prints the documentation's own table rather than a paraphrase of it.

Run version first whenever the answer depends on a recent feature. If it reports stale, refresh and re-read the reference file covering the area you are touching.

Facts that are usually misremembered

Every row below was answered wrongly by a competent agent working from memory.

Claim that feels rightActually
Photos are 10 MB whatever the transportBy URL: 5 MB (20 MB other types). By upload: 10 MB (50 MB other). By file_id: unlimited.
30 msg/s is a global API request capIt applies to bulk notifications only. There is no documented global request cap.
You just have to stay under 30/sallow_paid_broadcast raises it to 1000/s at 0.1 Stars per message past the free 30.
Telegram sends Retry-After headersIt sends no rate-limit headers. Read parameters.retry_after from the JSON body.
Self-hosting the Bot API server raises send limitsIt does not. File sizes and webhook transport only.
copy_text buttons came in 7.57.11 (2024-10-31).
BotCommand.description is 3–2561–256.
A poll takes 2–10 options1–12 since 9.1/10.0.
signature is excluded from the initData HMACOnly hash is. signature is signed data. (The Ed25519 check excludes both.)
Bot API 8.0 shipped around Aug 20242024-11-17.
allowed_updates defaults to everythingIt defaults to the previous value, and never includes chat_member, message_reaction, message_reaction_count unless asked.

Transcribe the Ed25519 public keys from references/mini-apps.md; never retype them. A key one byte short rejects every payload — with a clear length error in Python, but as an ordinary signature mismatch in looser stacks.

Where things are

FileCovers
references/limits.mdRate limits (official vs folklore), paid broadcasts, file-size ceilings per transport, every length limit
references/errors.mdThe response envelope, three-bucket error classification with exact description substrings, backoff, idempotency, webhook retries
references/sending.mdparse_mode choice and escaping, entities, link previews, media groups, inline keyboards, the 64-byte callback_data budget
references/updates.mdPolling vs webhooks, allowed_updates, the full Update field list, offsets, command scopes
references/mini-apps.mdinitData delivery and both validation schemes, origin hardening, launch surfaces, WebApp JS version gates
references/payments.mdStars vs card rails, invoice flow, pre-checkout, subscriptions, refunds
references/versions.mdChangelog navigation, 10.x summary, library → Bot API support
scripts/tg-api.pyThe query/refresh tool above
scripts/initdata.pyTested initData validator, both schemes
scripts/test_initdata.pyIts fixtures — run it after changing the validator

Rules worth applying without being asked

  • Escape the data, then build the markup — never the reverse. Prefer HTML (3 characters to escape) over MarkdownV2 (18, including . - +).
  • Classify send failures into three buckets, not two. Permanent (stop), transient (retry), unknown (bounded retry, then alert). Folding "unknown" into "permanent" deletes live users.
  • Match error description as a substring, never whole-string — Telegram prepends Forbidden: / Bad Request: inconsistently across cases.
  • Budget callback_data in bytes. 64 bytes; Cyrillic costs 2 per character, so it overflows in production and fails as a 400 at send time.
  • There is no idempotency key. A timed-out send may have been delivered; keep your own dedup table.
  • answerCallbackQuery on every callback, even a no-op, or the client spins.
  • Never trust initDataUnsafe for authorization, and never let an iframe call window.Telegram.WebApp — origin hardening has been enforced since 2026-07-20.

Red flags

Stop and run tg-api.py show instead:

  • About to state a size, length or rate limit from memory.
  • About to say which version introduced a field.
  • Reaching for a field name you have not seen in this session's tool output.
  • Reading a version off the changelog's first match — it is reverse-chronological, so that is the most recent touch, not the introduction.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.