GenServer that long-polls Telegram for updates and dispatches them to handlers.
This module implements the core polling loop that fetches updates from Telegram and routes them to the appropriate handlers in your bot module and routers.
Responsibilities
- Long polling: Continuously fetches updates from Telegram API
- Message parsing: Converts raw Telegram updates into typed structs
- Handler dispatch: Routes messages and callbacks to appropriate handlers
- FSM integration: Loads and saves per-user state before/after handlers
- Router chain: Tries routers in order before falling back to main bot module
Handler Chain
When an update arrives, handlers are tried in this order:
- Each router module (in the order specified)
- The main bot module
If a handler returns :pass, the next handler in the chain is tried.
Otherwise, the result is processed and the chain stops.
Summary
Functions
Returns a specification to start this module under a supervisor.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(module(), atom(), [module()]) :: GenServer.on_start()