# `BaileysEx.Message.Sender`
[🔗](https://github.com/jeffhuen/baileys_ex/blob/main/lib/baileys_ex/message/sender.ex#L1)

Message send pipeline.

# `context`

```elixir
@type context() :: %{
  :signal_repository =&gt; BaileysEx.Signal.Repository.t(),
  :signal_store =&gt; BaileysEx.Signal.Store.t(),
  :me_id =&gt; String.t(),
  optional(:device_identity) =&gt; binary(),
  optional(:enable_recent_message_cache) =&gt; boolean(),
  optional(:me_lid) =&gt; String.t(),
  optional(:store_ref) =&gt; BaileysEx.Connection.Store.Ref.t(),
  optional(:query_fun) =&gt; (BaileysEx.BinaryNode.t() -&gt;
                             {:ok, BaileysEx.BinaryNode.t()} | {:error, term()}),
  optional(:send_node_fun) =&gt; (BaileysEx.BinaryNode.t() -&gt;
                                 :ok | {:error, term()}),
  optional(:socket) =&gt; GenServer.server(),
  optional(:cached_group_metadata) =&gt; (String.t() -&gt; {:ok, map()} | nil),
  optional(:group_metadata_fun) =&gt; (String.t() -&gt;
                                      {:ok, map()} | {:error, term()})
}
```

# `proto_message`

```elixir
@type proto_message() :: struct()
```

# `send_result`

```elixir
@type send_result() :: %{
  id: String.t(),
  jid: BaileysEx.JID.t(),
  message: proto_message(),
  timestamp: integer()
}
```

# `send`

```elixir
@spec send(context(), BaileysEx.JID.t(), map(), keyword()) ::
  {:ok, send_result(), context()} | {:error, term()}
```

Sends a generic content map to the specified JID, converting maps to WAProto messages.

# `send_proto`

```elixir
@spec send_proto(context(), BaileysEx.JID.t(), proto_message(), keyword()) ::
  {:ok, send_result(), context()} | {:error, term()}
```

Serializes, encrypts, and transmits a pre-constructed WAProto message to a specific JID.

# `send_status`

```elixir
@spec send_status(context(), map(), keyword()) ::
  {:ok, map(), context()} | {:error, term()}
```

Uploads a new status update to all valid contacts via status broadcast channel.

---

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