- SUMMARY.md with implementation details and self-check passed - STATE.md updated with progress, metrics, decisions - Requirements TELE-01, TELE-02, TELE-03, TELE-04, TELE-06 marked complete
2.8 KiB
2.8 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | |||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 17 | 03 | telegram-bot |
|
|
|
|
|
|
Phase 17 Plan 03: Bot Command Handlers Summary
Telegram bot command handlers for 8 commands using telego v1.8.0, wrapping existing scan/verify/recon/storage functionality.
Tasks Completed
| Task | Name | Commit | Files |
|---|---|---|---|
| 1+2 | Bot package + 8 command handlers | 9ad5853 |
pkg/bot/bot.go, pkg/bot/handlers.go, pkg/bot/source.go, go.mod, go.sum |
| 3 | Unit tests for handlers | 202473a |
pkg/bot/handlers_test.go |
Implementation Details
Bot Package Structure
bot.go: Bot struct with Deps injection (engine, verifier, recon, storage, registry, encKey), RegisterHandlers method wiring telego BotHandlerhandlers.go: 8 command handlers (/help, /scan, /verify, /recon, /status, /stats, /providers, /key) plus extractArg and storageToEngine helperssource.go: selectBotSource for file/directory path resolution (subset of CLI source selection)
Command Security Model
/key <id>: Private chat only. Returns full unmasked key, refuses in group/supergroup chats- All other commands: Masked keys only. Never expose raw key material in group contexts
- Scan results capped at 20 items with overflow indicator
Handler Registration
Commands registered via th.CommandEqual("name") predicates on the BotHandler. Each handler returns error but uses reply messages for user-facing errors rather than returning errors to telego.
Decisions Made
- Handler context: telego's
*th.Contextimplementscontext.Context, used for timeout propagation in scan/recon operations - /key private-only: Enforced via
msg.Chat.Type == "private"check, returns denial message in groups - Deps struct pattern: All dependencies injected via
Depsstruct toNew()constructor, avoiding global state
Deviations from Plan
None - plan executed exactly as written.
Known Stubs
None. All 8 handlers are fully wired to real engine/verifier/recon/storage functionality.