telegram-bot-api

A reference for communicating with Telegram through its Bot API, the HTTP interface used by Telegram bots, without a Telegram-specific software library.

In plain words
What is it for?
Use it when building or changing Telegram transport code, including long polling, inline keyboards, queued messages, forum topics, voice transcription, and media groups.
Why use it?
It documents how Untether sends messages, handles updates and button clicks, limits request rates, and processes media or voice messages.

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/littlebearapps/untether/telegram-bot-api
Any agent
npx skills add littlebearapps/untether --skill telegram-bot-api
Clone the repo
git clone --depth 1 https://github.com/littlebearapps/untether

Made for: Claude Code, Codex.

Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,529 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.00071 $0.01529
Opus 5 $0.00036 $0.00764
Sonnet 5 $0.00014 $0.00306
Haiku 4.5 $0.00007 $0.00153

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

Security

Grade A, and why

telegram-bot-api 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 3d 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.

.claude/skills/telegram-bot-api/SKILL.md · 166 lines

How it starts

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

Telegram Bot API (Raw HTTP)

Untether uses a custom Telegram Bot API client built on httpx (async) and msgspec (JSON). There is no Telegram SDK dependency.

Key files

File Purpose
src/untether/telegram/client.py TelegramClient — all Bot API calls
src/untether/telegram/outbox.py TelegramOutbox — queued send/edit/delete with rate limiting
src/untether/telegram/bridge.py TelegramPresenter — renders progress, inline keyboards, answers
src/untether/telegram/loop.py Long polling loop (getUpdates), callback dispatch
src/untether/telegram/commands/ Command and callback handlers
docs/reference/transports/telegram.md Full transport reference

Bot API call pattern

All calls go through TelegramClient, which wraps httpx.AsyncClient:

# Typical Bot API call (inside TelegramClient)
resp = await self._http.post(
    f"{self._base_url}/bot{self._token}/{method}",
    json=params,
)
data = msgspec.json.decode(resp.content, type=TelegramResponse)
  • Base URL: https://api.telegram.org
  • Auth: bot token in the URL path (/bot<token>/)
  • All responses decoded with msgspec.json.decode into typed structs
  • Error handling: check ok field, raise on HTTP or Telegram errors

Inline keyboards and callback queries

Permission requests and plan mode buttons use Telegram inline keyboards:

# reply_markup structure in RenderedMessage.extra
{
    "reply_markup": {
        "inline_keyboard": [
            [{"text": "Approve", "callback_data": "ctrl:approve:<request_id>"}],
            [{"text": "Deny", "callback_data": "ctrl:deny:<request_id>"}],
            [{"text": "Pause & Outline Plan", "callback_data": "ctrl:discuss:<request_id>"}],
        ]
    }
}
  • Callback data format: <prefix>:<action>:<id> (max 64 bytes)
  • Must call answerCallbackQuery promptly to clear the spinner
  • Early answering: set answer_early = True on the backend to clear the spinner immediately with a toast

Read the full file on GitHub · 166 lines

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. 3d ago First seen · 166 lines · 71 tokens per session scan A 632f60c0bbf0

Subscribe to this mod's changes

telegram-bot-api is a skill published in the GitHub repository littlebearapps/untether (66 stars, last pushed 3d ago), licensed MIT. It adds 71 tokens to every session and 1,529 once invoked, about $0.0004 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

external-context

Invoke parallel document-specialist agents for external web searches and documentation lookup.

Yeachan-Heo/oh-my-claudecode · 16 tokens

reflect

Review recent work, find repeated workflow patterns, and suggest reusable skills, agents, commands, config changes, or playbooks. Use when the user asks to learn from past sessions, improve recurring workflows, or identify what should be turned into reusable agent instructions.

alvinunreal/oh-my-opencode-slim · 53 tokens

codemap

Generate comprehensive hierarchical codemaps for UNFAMILIAR repositories. Expensive operation - only use when explicitly asked for codebase documentation or initial repository mapping.

alvinunreal/oh-my-opencode-slim · 34 tokens

scientific-schematics

Create publication-quality scientific diagrams using Nano Banana 2 AI with smart iterative refinement. Uses Gemini 3.1 Pro Preview for quality review. Only regenerates if quality is below threshold for your document type. Specialized in neural network architectures, system diagrams, flowcharts, biological pathways…

xintaofei/codeg · 68 tokens

openpets

Use when the user asks to install, configure, verify, troubleshoot, or understand OpenPets; install or select a pet; connect Claude Code, OpenCode, Cursor, Codex, or MCP clients; configure a project to use a specific pet; or debug openpetsstatus, openpetsreact, or openpetssay.

alvinunreal/openpets · 70 tokens

southwest

Search Southwest Airlines fares and points pricing via Patchright browser automation. SW is not in any GDS or API. Covers all fare classes, Companion Pass value, and fare drop monitoring.

borski/travel-hacking-toolkit · 40 tokens