# `BaileysEx.Feature.Presence`
[🔗](https://github.com/jeffhuen/baileys_ex/blob/main/lib/baileys_ex/feature/presence.ex#L1)

Presence helpers aligned with Baileys' presence and chatstate behavior.

# `presence`

```elixir
@type presence() :: :unavailable | :available | :composing | :recording | :paused
```

Presence states supported by Baileys.

# `presence_update`

```elixir
@type presence_update() :: %{
  id: String.t(),
  presences: %{required(String.t()) =&gt; map()}
}
```

Parsed presence payload emitted through the event emitter.

# `handle_update`

```elixir
@spec handle_update(
  BaileysEx.BinaryNode.t(),
  keyword()
) :: {:ok, presence_update()} | :ignore | {:error, :invalid_presence_node}
```

Parse an incoming presence or chatstate node and optionally emit `presence_update`.

# `send_update`

```elixir
@spec send_update(term(), presence(), String.t() | nil, keyword()) ::
  :ok | {:error, term()}
```

Send a Baileys-compatible presence or chatstate update.

# `subscribe`

```elixir
@spec subscribe(term(), String.t(), keyword()) :: :ok | {:error, term()}
```

Subscribe to presence updates for a JID, appending a TC token when one exists.

---

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