Nadia.Handler behaviour (nadia v1.2.0)

View Source

Behaviour for modules that handle incoming Telegram updates.

Handlers receive the parsed %Nadia.Model.Update{} and a Nadia.Context with the effective message, chat, user, and client already extracted.

Summary

Types

result()

@type result() :: :ok | :ignore | {:ok, term()} | {:error, term()}

Callbacks

handle_update(t, t)

@callback handle_update(Nadia.Model.Update.t(), Nadia.Context.t()) :: result()