Skip to content

miniproto.updates.manager.UpdateManager.on

miniproto.updates.manager.UpdateManager.on

Section titled “miniproto.updates.manager.UpdateManager.on”
on(update_type: type[UpdateT], handler: UpdateHandler[UpdateT] | None = None) -> UpdateHandler[UpdateT] | Callable[[UpdateHandler[UpdateT]], UpdateHandler[UpdateT]]

Register a handler directly or return a decorator for one update subtype.

Parameters:

  • update_type (type[UpdateT]) – Normalized update subclass to match with isinstance.
  • handler (UpdateHandler[UpdateT] | None) – Optional synchronous or asynchronous callback.

Returns: