AGENT SKILL
telegram-bot-development
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-10-14
- Stars
- ★ 0
- Forks
- 0
02 资源文件 7
- 参考文档manifest.yaml587 B
- 参考文档references/api-basics.md1.5 KB
- 参考文档references/bot-messages.md3.8 KB
- 参考文档references/coroutines-integration.md2.6 KB
- 参考文档references/keyboards.md2.5 KB
- 参考文档references/message-handlers.md3.0 KB
- 参考文档references/security-deployment.md2.4 KB
03 SKILL.md 正文
Telegram Bot Development (Kotlin)
Workflow
- Identify the task type from the user request.
- Pick the matching row in the Decision Table below.
- Read the linked reference file in
references/. - Apply the patterns from that reference together with the Always-Active Rules below.
Decision Table
| If the task is about… | Read first |
|---|---|
| Bot registration, long-polling setup, initial wiring | references/api-basics.md |
| Parsing commands, routing updates, MessageHandler dispatch | references/message-handlers.md |
| Inline keyboards, callback queries, button flows | references/keyboards.md |
| Bot token security, input validation, deployment, shutdown | references/security-deployment.md |
| Suspend handlers, coroutine scope, dispatcher rules | references/coroutines-integration.md |
| Adding, modifying, or using user-facing bot message strings | references/bot-messages.md |
Always-Active Rules
- Command flow:
TelegramBot → MessageHandler → Command → Controller → Service - Never call a
Servicedirectly from aCommand— always route through aController ControllerreturnsCommandResponse;Commandowns emoji prefixes and final text assembly- Never expose stack traces to users; send a generic error message instead
BOT_TOKENmust come from an environment variable — never hardcode it- Never hardcode user-facing strings in commands or controllers — always use
BotMessagesbacked bymessages.properties; seereferences/bot-messages.md
Output Format
When implementing bot features:
- Architecture summary — which layer is modified and why
- Code snippet — the new command/handler/helper with Kotlin idioms
- Registration note — if a new command needs to be registered in
MessageHandler - Test hint — which integration test pattern to follow
Do NOT
- Do NOT load all references at once — pick exactly one based on the Decision Table.
- Do NOT call a
Servicefrom aCommand— this violates the layer boundary. - Do NOT hardcode
BOT_TOKENor any credentials in source files. - Do NOT use
GlobalScopefor coroutines in handlers — use the injected scope. - Do NOT skip
answerCallbackQueryfor callback queries, even if no popup is shown. - Do NOT hardcode user-facing strings in commands or controllers — all text goes in
messages.propertiesand is accessed viaBotMessages.
Error Handling
- If no row in the Decision Table matches, ask the user to clarify before proceeding.
- If a reference file is missing, stop and report the exact path.
- Wrap all
execute()calls in try-catch; handleTelegramApiExceptionandTelegramApiRequestExceptionseparately.
Related Skills
kotlin-specialist— coroutine scope design, sealed classes forCommandResponsepostgresql-exposed-orm— DB access patterns called from Servicesunit-testing-kotlin— integration test patterns
Example Invocation
- User: "Add a /stats command to the bot" → load
references/message-handlers.md, implement Command → Controller → Service chain. - User: "Build a confirm/cancel inline keyboard for a delete action" → load
references/keyboards.md, apply callback data format andanswerCallbackQuerypattern.
04 同仓库更多 Skills
universal-skill
暂无简介
★ 0
notion-skill
暂无简介
★ 0
inline-frontmatter-skill
Hand-authored description that already lives in the body and must not be double-wrapped.
★ 0
universal-skill
暂无简介
★ 0
notion-skill
暂无简介
★ 0
write-a-skill
暂无简介
★ 0