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

Mini DSL to build answers based on the context (`ExGram.Cnt`) easily.

This module is automatically imported when using `ExGram.Bot`. Functions in this
module allow you to build responses declaratively by chaining operations on the
context. The responses are queued and executed after your handler returns.

See the [Sending Messages](sending-messages.md) guide for detailed usage examples.

# `message_type`

```elixir
@type message_type() ::
  :text
  | :animation
  | :audio
  | :document
  | :photo
  | :sticker
  | :story
  | :video
  | :video_note
  | :voice
  | :contact
  | :dice
  | :game
  | :poll
  | :venue
  | :location
  | :invoice
  | :successful_payment
  | :giveaway
```

# `update_type`

```elixir
@type update_type() ::
  :message
  | :edited_message
  | :channel_post
  | :edited_channel_post
  | :business_connection
  | :business_message
  | :edited_business_message
  | :deleted_business_messages
  | :message_reaction
  | :message_reaction_count
  | :inline_query
  | :chosen_inline_result
  | :callback_query
  | :shipping_query
  | :pre_checkout_query
  | :purchased_paid_media
  | :poll
  | :poll_answer
  | :my_chat_member
  | :chat_member
  | :chat_join_request
  | :chat_boost
  | :removed_chat_boost
```

# `answer`

```elixir
@spec answer(ExGram.Cnt.t(), String.t(), keyword()) :: ExGram.Cnt.t()
@spec answer(ExGram.Cnt.t(), ExGram.Model.Message.t(), String.t()) :: ExGram.Cnt.t()
```

# `answer`

```elixir
@spec answer(ExGram.Cnt.t(), ExGram.Model.Message.t(), String.t(), keyword()) ::
  ExGram.Cnt.t()
```

# `answer_callback`

```elixir
@spec answer_callback(ExGram.Cnt.t(), ExGram.Model.Message.t(), keyword()) ::
  ExGram.Cnt.t()
```

# `answer_document`

```elixir
@spec answer_document(ExGram.Cnt.t(), ExGram.File.file(), keyword()) :: ExGram.Cnt.t()
@spec answer_document(ExGram.Cnt.t(), ExGram.Model.Message.t(), ExGram.File.file()) ::
  ExGram.Cnt.t()
```

# `answer_document`

```elixir
@spec answer_document(
  ExGram.Cnt.t(),
  ExGram.Model.Message.t(),
  ExGram.File.file(),
  keyword()
) ::
  ExGram.Cnt.t()
```

# `answer_inline_query`

```elixir
@spec answer_inline_query(
  ExGram.Cnt.t(),
  [ExGram.Model.InlineQueryResult.t()],
  keyword()
) ::
  ExGram.Cnt.t()
```

# `create_inline`

Deprecated, use `create_inline_keyboard/1` instead

# `create_inline_keyboard`

```elixir
@spec create_inline_keyboard([[map() | keyword()]]) ::
  ExGram.Model.InlineKeyboardMarkup.t()
```

# `create_reply_keyboard`

```elixir
@spec create_reply_keyboard(
  [[map() | keyword()]],
  keyword()
) :: ExGram.Model.ReplyKeyboardMarkup.t()
```

# `delete`

```elixir
@spec delete(ExGram.Cnt.t()) :: ExGram.Cnt.t()
```

# `delete`

```elixir
@spec delete(ExGram.Cnt.t(), ExGram.Model.Message.t() | nil) :: ExGram.Cnt.t()
```

# `delete`

```elixir
@spec delete(ExGram.Cnt.t(), ExGram.Model.Message.t(), keyword()) :: ExGram.Cnt.t()
```

# `edit`

```elixir
@spec edit(ExGram.Cnt.t(), :inline, String.t()) :: ExGram.Cnt.t()
@spec edit(ExGram.Cnt.t(), :markup, keyword()) :: ExGram.Cnt.t()
```

# `edit`

```elixir
@spec edit(ExGram.Cnt.t(), :inline, String.t(), keyword()) :: ExGram.Cnt.t()
@spec edit(ExGram.Cnt.t(), :markup, ExGram.Model.Message.t(), keyword()) ::
  ExGram.Cnt.t()
```

# `edit`

```elixir
@spec edit(ExGram.Cnt.t(), :inline, ExGram.Model.Message.t(), String.t(), keyword()) ::
  ExGram.Cnt.t()
@spec edit(ExGram.Cnt.t(), :markup, ExGram.Model.Message.t(), String.t(), keyword()) ::
  ExGram.Cnt.t()
```

# `extract_callback_id`

# `extract_chat`

```elixir
@spec extract_chat(ExGram.Model.Update.t()) :: {:ok, ExGram.Model.Chat.t()} | :error
```

# `extract_group`

```elixir
@spec extract_group(ExGram.Model.Update.t() | ExGram.Model.Message.t()) ::
  {:ok, ExGram.Model.Chat.t()} | :error
```

# `extract_id`

```elixir
@spec extract_id(ExGram.Model.Update.t() | ExGram.Model.Message.t()) ::
  {:ok, integer()} | -1
```

# `extract_inline_id_params`

# `extract_message_id`

# `extract_message_type`

```elixir
@spec extract_message_type(ExGram.Model.Message.t()) :: {:ok, message_type()} | :error
```

# `extract_response_id`

# `extract_update_type`

```elixir
@spec extract_update_type(ExGram.Model.Update.t()) :: {:ok, update_type()} | :error
```

# `extract_user`

```elixir
@spec extract_user(ExGram.Model.Update.t() | ExGram.Model.Message.t()) ::
  {:ok, ExGram.Model.User.t()} | :error
```

# `on_result`

```elixir
@spec on_result(ExGram.Cnt.t(), (response :: any(), name :: atom() -&gt; any())) ::
  ExGram.Cnt.t()
```

# `send_answers`

```elixir
@spec send_answers(ExGram.Cnt.t()) :: ExGram.Cnt.t()
```

---

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