telegram
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTelegram (Skill Router)
Telegram(Skill Router)
Router skill: pick the reference that matches your task.
路由技能:选择与你的任务匹配的参考文档。
Quick Navigation
快速导航
| Task | Reference |
|---|---|
| New to Telegram bots | bots-overview.md |
| Bot capabilities overview | bot-features.md |
| API methods/types | bot-api.md |
| Webhook setup & security | webhooks.md |
| aiogram 3 handlers/FSM | aiogram-patterns.md |
| Keyboard UX | keyboard-design.md |
| Inline mode | inline-mode.md |
| Mini Apps (Web Apps) | mini-apps.md |
| Payments (Stars) | payments.md |
| Authentication (Login Widget, URL Auth) | authentication.md |
| Rate limits & performance | performance.md |
| 任务 | 参考文档 |
|---|---|
| 首次接触Telegram机器人 | bots-overview.md |
| 机器人功能概览 | bot-features.md |
| API方法/类型 | bot-api.md |
| Webhook设置与安全 | webhooks.md |
| aiogram 3处理器/FSM | aiogram-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 — always respond
answer_callback_query - ❌ 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层(如果存在)