# `ExGram.Handler`
[🔗](https://github.com/rockneurotiko/ex_gram/blob/0.65.0/lib/ex_gram/handler.ex#L1)

Behaviour for handling updates in `ExGram.Bot` implementations.

Implement this behaviour in your bot module to handle incoming updates from Telegram.
The `c:handle/2` callback receives parsed messages and a context struct, while
`c:handle_error/1` handles any errors that occur during message processing.

See the [Handling Updates guide](handling-updates.md) for more details.

# `init_opts`

```elixir
@type init_opts() :: [bot: atom() | String.t(), token: String.t(), extra_info: map()]
```

# `handle`
*optional* 

```elixir
@callback handle(ExGram.Dispatcher.parsed_message(), ExGram.Cnt.t()) :: ExGram.Cnt.t()
```

# `handle_error`
*optional* 

```elixir
@callback handle_error(ExGram.Error.t()) :: any()
```

# `init`

```elixir
@callback init(init_opts()) :: :ok
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
