ExGram.Dispatcher (ex_gram v0.56.0)
View SourceNamed process that receive the updates, apply the middlewares for the bot and call the bot's handler
Summary
Functions
Returns a specification to start this module under a supervisor.
Types
@type custom_key() :: any()
@type parsed_message() :: {:command, key :: String.t() | custom_key(), ExGram.Model.Message.t()} | {:text, String.t(), ExGram.Model.Message.t()} | {:regex, key :: custom_key(), ExGram.Model.Message.t()} | {:location, ExGram.Model.Location.t()} | {:message, ExGram.Model.Message.t()} | {:callback_query, ExGram.Model.CallbackQuery.t()} | {:inline_query, ExGram.Model.InlineQuery.t()} | {:edited_message, ExGram.Model.Message.t()} | {:update, ExGram.Model.Update.t()}
@type t() :: %ExGram.Dispatcher{ bot_info: ExGram.Model.User.t() | nil, bot_module: term(), commands: %{required(String.t()) => map()}, dispatcher_name: atom(), error_handler: {module(), atom()}, extra_info: map(), handler: {module(), atom()}, middlewares: [ExGram.Bot.middleware()], name: atom(), regex: [Regex.t()] }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec init_state(atom(), ExGram.Model.User.t() | nil, module(), map()) :: t()
@spec new(Enumerable.t()) :: t()
@spec start_link(t()) :: GenServer.on_start()