Skip to content
Nine499Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram Bot API 中文文档

基于 Telegram 官方 Bot API 页面 https://core.telegram.org/bots/api 的完整简体中文翻译,面向开发者与 AI Agent。

  • 对应版本:Bot API 10.3(2026-08-24)
  • 页面抓取日期:2026-11-07
  • 规模:19 章、185 个方法、400 个类型、37 个专题小节、622 个锚点、3943 行表格
  • 官方英文页面为权威来源;本仓库为非官方中文翻译

文档入口

用途 文件
总览与阅读说明 telegram-bot-api-zh/README.md
Agent 最短入口 telegram-bot-api-zh/AGENTS.md
机器可读索引 telegram-bot-api-zh/INDEX.json
人类可读索引 telegram-bot-api-zh/INDEX.md
单文件全文 telegram-bot-api-zh/full.md
来源与校验记录 telegram-bot-api-zh/PROVENANCE.md

快速定位一个方法:

jq -r '.sections[] | select(.name=="sendMessage") | [.file,.anchor,.official_url] | @tsv' \
  telegram-bot-api-zh/INDEX.json

仓库结构

.
├── telegram-bot-api-zh/   # 最终交付文档(生成物,直接阅读)
├── translations/          # 分部分中文译稿(构建输入,可编辑)
│   ├── TRANSLATION-BRIEF.md
│   └── zh-part-*.md
├── tools/                 # 抓取、切分、构建、校验脚本
│   ├── extract.py
│   ├── split.py
│   ├── build.py
│   ├── verify.py
│   ├── check_links.py
│   └── pipeline.sh
├── work/                  # 抓取与构建中间产物(Git 忽略)
└── README.md

构建与校验

依赖:bash、uv、curl、Python 3.10+(脚本只用标准库)。

./tools/pipeline.sh fetch    # 下载官方页面到 work/raw/tgapi.html
./tools/pipeline.sh extract  # 提取正文到 work/api-extracted.md
./tools/pipeline.sh split    # 切分为 work/en/part-*.md
./tools/pipeline.sh build    # 从 translations/ 生成 telegram-bot-api-zh/
./tools/pipeline.sh verify   # 结构校验 + 最终文档内部链接检查
./tools/pipeline.sh all      # build + verify

说明:

  • fetch 会重新下载官方页面。页面更新后,内容可能与当前译文不一致;当前快照的 SHA-256 记录在 telegram-bot-api-zh/PROVENANCE.md。
  • build 只读取 translations/,不会重新翻译。
  • clean 只删除 work/,不会删除最终文档。

翻译约定

  • 逐段、逐表完整翻译,不省略、不概括、不合并。
  • API 类型名、方法名、字段名、枚举值、代码、URL 保持英文原样。
  • 表格结构固定:方法为 参数 | 类型 | 是否必需 | 说明,类型为 字段 | 类型 | 说明。
  • 锚点与官方页面一致;分章文件的跨文件链接改写为 文件.md#锚点,full.md 中为 #锚点。
  • 详细规范见 translations/TRANSLATION-BRIEF.md。

更新译文

  1. 编辑 translations/zh-part-*.md,不要直接改 telegram-bot-api-zh/ 下的生成物。
  2. 运行 ./tools/pipeline.sh build 重新生成最终文档。
  3. 运行 ./tools/pipeline.sh verify,确认结构与链接仍然一致。

当前快照校验

  • 18/18 翻译分段结构一致(标题、锚点、表格行、代码围栏)
  • 622/622 官方页面锚点;缺失 0,重复 0
  • 3943/3943 表格行
  • 全部内部链接可解析
  • 代码块内容与源稿逐字节一致

校验命令:

uv run --no-project python tools/verify.py work/en translations
uv run --no-project python tools/check_links.py

版权与来源

官方文档内容版权归 Telegram Messenger 所有。本仓库为非官方中文翻译,仅供学习与开发参考;如译文与官方英文页面冲突,以官方页面为准。

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages