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

Group-management helpers mapped from Baileys' `groups.ts`.

# `participant_result`

```elixir
@type participant_result() :: %{
  :jid =&gt; String.t(),
  :status =&gt; String.t(),
  optional(:content) =&gt; BaileysEx.BinaryNode.t()
}
```

# `accept_invite`

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

Accept a legacy invite code and return the joined group JID.

# `accept_invite_v4`

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

Accept a v4 invite and emit the same post-join side effects Baileys performs
when callback options are provided.

# `add_participants`

```elixir
@spec add_participants(term(), String.t(), [String.t()]) ::
  {:ok, [participant_result()]} | {:error, term()}
```

Add participants to a group.

# `create`

```elixir
@spec create(term(), String.t(), [String.t()], keyword()) ::
  {:ok, map()} | {:error, term()}
```

Create a new group and return the parsed group metadata.

# `demote_participants`

```elixir
@spec demote_participants(term(), String.t(), [String.t()]) ::
  {:ok, [participant_result()]} | {:error, term()}
```

Demote participants from admins.

# `extract_group_metadata`

```elixir
@spec extract_group_metadata(BaileysEx.BinaryNode.t()) :: map()
```

Extract Baileys-aligned group metadata from a group IQ result node.

# `fetch_all_participating`

```elixir
@spec fetch_all_participating(
  term(),
  keyword()
) :: {:ok, %{required(String.t()) =&gt; map()}} | {:error, term()}
```

Fetch all participating groups and optionally emit `groups_update`.

# `get_invite_info`

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

Resolve invite metadata for a code without joining.

# `get_metadata`

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

Fetch interactive metadata for a group.

# `handle_dirty_update`

```elixir
@spec handle_dirty_update(term(), %{type: String.t()}, keyword()) ::
  {:ok, %{required(String.t()) =&gt; map()}} | :ignore | {:error, term()}
```

Handle a dirty group/community update by refetching groups and cleaning the bucket.

# `invite_code`

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

Fetch the current invite code for a group.

# `join_approval_mode`

```elixir
@spec join_approval_mode(term(), String.t(), :on | :off) :: :ok | {:error, term()}
```

Toggle join-approval mode for a group.

# `leave`

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

Leave a group.

# `member_add_mode`

```elixir
@spec member_add_mode(term(), String.t(), :admin_add | :all_member_add) ::
  :ok | {:error, term()}
```

Switch whether only admins or all members can add participants.

# `promote_participants`

```elixir
@spec promote_participants(term(), String.t(), [String.t()]) ::
  {:ok, [participant_result()]} | {:error, term()}
```

Promote participants to admins.

# `remove_participants`

```elixir
@spec remove_participants(term(), String.t(), [String.t()]) ::
  {:ok, [participant_result()]} | {:error, term()}
```

Remove participants from a group.

# `request_participants_list`

```elixir
@spec request_participants_list(term(), String.t()) ::
  {:ok, [map()]} | {:error, term()}
```

Fetch the pending join-request list for a group.

# `request_participants_update`

```elixir
@spec request_participants_update(
  term(),
  String.t(),
  [String.t()],
  :approve | :reject
) ::
  {:ok, [participant_result()]} | {:error, term()}
```

Approve or reject pending join requests.

# `revoke_invite`

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

Revoke the current invite code and return the new one.

# `revoke_invite_v4`

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

Revoke a v4 invite for a specific invited user.

# `setting_update`

```elixir
@spec setting_update(
  term(),
  String.t(),
  :announcement | :not_announcement | :locked | :unlocked
) :: :ok | {:error, term()}
```

Update announcement or locked settings for a group.

# `toggle_ephemeral`

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

Enable or disable disappearing messages for a group.

# `update_description`

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

Update or clear the group description.

# `update_member_label`

```elixir
@spec update_member_label(map(), String.t(), String.t(), keyword()) ::
  {:ok, BaileysEx.Message.Sender.send_result(),
   BaileysEx.Message.Sender.context()}
  | {:error, term()}
```

Set a custom label on a group member via the GROUP_MEMBER_LABEL_CHANGE protocol message.

# `update_subject`

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

Update the subject for an existing group.

---

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