@@ -80,14 +80,32 @@ high-level album API); `EditMessageMedia`.
8080
8181## Phase 4 — Incoming: updates & handler framework
8282
83- - ☐ ` tg.Update* ` → ` botapi.Update ` mapping (message, edited, callback query,
84- inline query, chat member, etc.) via the dispatcher
85- - ☐ ` convert_message.go ` re-point + finish reply-to / forward resolution
86- - ☐ ` handler ` package: ` Group ` , ` Use ` /middleware, predicates, routing, context
87- - ☐ Built-in middleware: ` Recover ` , ` Timeout ` , rate-limit, logging
88- - ☐ Built-in predicates: command, prefix, chat type, media, regex
89- - ☐ ` Bot.On* ` convenience registration
90- - ☐ Decide & implement any ` getUpdates ` /webhook compatibility shim
83+ ** Done** on ` main ` . The framework lives in the root package (on ` *Bot ` ),
84+ consistent with the Phase 3 methods. ` installHandlers ` (called from New) binds
85+ the raw ` tg.UpdateDispatcher ` to a concurrency-safe router. See
86+ ` examples/echo ` for the end-to-end pipe.
87+
88+ - ☑ ` tg.Update* ` → ` botapi.Update ` mapping: new/edited messages, channel posts
89+ (broadcast → channel_post, supergroup → message), callback & inline queries
90+ (` updates_map.go ` , ` on.go ` ); senders resolved from harvested ` Entities `
91+ - ☑ ` convert.go ` re-point + reply-to + forward-origin resolution
92+ (user/hidden/chat/channel)
93+ - ☑ Routing: ` Group ` , ` Use ` /middleware (global + group-scoped), predicates,
94+ first-match dispatch, ` Context ` (` handler.go ` , ` group.go ` , ` context.go ` )
95+ - ☑ Built-in middleware: ` Recover ` , ` Timeout ` , ` Logging ` (rate-limit → Phase 6)
96+ - ☑ Built-in predicates: ` Command ` , ` HasPrefix ` , ` HasText ` , ` TextEquals ` ,
97+ ` Regex ` , ` ChatTypeIs ` , ` CallbackData ` /` CallbackPrefix ` , ` Not ` /` Or `
98+ (media predicate → Phase 5 alongside incoming media)
99+ - ☑ ` Bot.On* ` convenience: ` OnMessage ` , ` OnEditedMessage ` , ` OnChannelPost ` ,
100+ ` OnCallbackQuery ` , ` OnInlineQuery ` , ` OnCommand `
101+ - ☑ ** Decision: no ` getUpdates ` /webhook shim.** Updates arrive on the
102+ persistent MTProto connection; the native handler framework + ` Bot.Run ` is
103+ the only model. Decided against an HTTP-poll/webhook compatibility surface
104+ (resolves Decisions-needed #2 ).
105+
106+ Deferred within Phase 4: ` chat_member ` /` my_chat_member ` , ` poll ` /` poll_answer `
107+ and ` chosen_inline_result ` update routing (types exist; dispatcher wiring lands
108+ with the chat-management and query work in Phase 5).
91109
92110## Phase 5 — Files, queries, chat management
93111
@@ -137,10 +155,11 @@ high-level album API); `EditMessageMedia`.
137155## Decisions needed (maintainer)
138156
1391571 . ** ` file_unique_id ` ** — derive properly now (Phase 5) or keep stubbed initially?
140- 2 . ** HTTP Bot-API compatibility** — ship ` getUpdates ` /webhook shims for drop-in
141- telego migration, or MTProto-native handlers only?
142- 3 . ** Unions** — sealed interfaces (recommended) vs. type-param generics?
143- 4 . ** Module surface** — single root package, or split ` handler ` /` pool ` into
144- sub-packages from day one?
145- 5 . ** ` appID ` /` appHash ` ** — bundled default vs. caller-provided (bots still need
146- an app identity for MTProto).
158+ 2 . ~~ ** HTTP Bot-API compatibility** ~~ — ** Resolved (Phase 4): MTProto-native
159+ handlers only, no ` getUpdates ` /webhook shim.**
160+ 3 . ~~ ** Unions** ~~ — ** Resolved (Phase 2): sealed interfaces** , guarded by the
161+ ` gochecksumtype ` exhaustiveness linter.
162+ 4 . ~~ ** Module surface** ~~ — ** Resolved (Phases 2–4): single root package** ;
163+ ` pool ` re-points in Phase 7.
164+ 5 . ** ` appID ` /` appHash ` ** — bundled default vs. caller-provided (currently
165+ caller-provided and required).
0 commit comments