telegram

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Telegram (Skill Router)

Telegram(Skill Router)

Router skill: pick the reference that matches your task.
路由技能:选择与你的任务匹配的参考文档。

Quick Navigation

快速导航

TaskReference
New to Telegram botsbots-overview.md
Bot capabilities overviewbot-features.md
API methods/typesbot-api.md
Webhook setup & securitywebhooks.md
aiogram 3 handlers/FSMaiogram-patterns.md
Keyboard UXkeyboard-design.md
Inline modeinline-mode.md
Mini Apps (Web Apps)mini-apps.md
Payments (Stars)payments.md
Authentication (Login Widget, URL Auth)authentication.md
Rate limits & performanceperformance.md
任务参考文档
首次接触Telegram机器人bots-overview.md
机器人功能概览bot-features.md
API方法/类型bot-api.md
Webhook设置与安全webhooks.md
aiogram 3处理器/FSMaiogram-patterns.md
键盘用户体验keyboard-design.md
内联模式inline-mode.md
Mini Apps(Web Apps)mini-apps.md
支付(Stars)payments.md
身份验证(Login Widget、URL Auth)authentication.md
速率限制与性能performance.md

Critical Prohibitions

重要禁令

  • ❌ No polling + webhooks simultaneously for same bot
  • ❌ No hardcoded tokens/secrets — use environment variables
  • ❌ No secrets in callback_data or logs
  • ❌ No ignoring
    answer_callback_query
    — always respond
  • ❌ No blocking work in webhook handlers — use background tasks
  • ❌ No trusting Login Widget data without hash verification
  • ❌ 同一机器人不能同时使用轮询和Webhook
  • ❌ 不要硬编码令牌/密钥——使用环境变量
  • ❌ 不要在callback_data或日志中包含密钥
  • ❌ 不能忽略
    answer_callback_query
    ——必须始终响应
  • ❌ 不要在Webhook处理器中执行阻塞操作——使用后台任务
  • ❌ 不要在未验证哈希的情况下信任Login Widget的数据

Definition of Done

完成标准

  • Webhook handlers validate
    X-Telegram-Bot-Api-Secret-Token
  • Keyboards: max 2 buttons per row, mobile-first
  • Callback data validated, not trusted blindly
  • Handlers are idempotent or have de-duplication
  • Webhook处理器验证
    X-Telegram-Bot-Api-Secret-Token
  • 键盘:每行最多2个按钮,移动端优先
  • 验证回调数据,不要盲目信任
  • 处理器是幂等的,或具备去重机制

Related Skills

相关技能

  • PostgreSQL — for database layer
  • FastAPI — for API layer (if exists)
  • PostgreSQL — 用于数据库层
  • FastAPI — 用于API层(如果存在)