Group-management helpers mapped from Baileys' groups.ts.
Summary
Functions
Accept a legacy invite code and return the joined group JID.
Accept a v4 invite and emit the same post-join side effects Baileys performs when callback options are provided.
Add participants to a group.
Create a new group and return the parsed group metadata.
Demote participants from admins.
Extract Baileys-aligned group metadata from a group IQ result node.
Fetch all participating groups and optionally emit groups_update.
Resolve invite metadata for a code without joining.
Fetch interactive metadata for a group.
Handle a dirty group/community update by refetching groups and cleaning the bucket.
Fetch the current invite code for a group.
Toggle join-approval mode for a group.
Leave a group.
Switch whether only admins or all members can add participants.
Promote participants to admins.
Remove participants from a group.
Fetch the pending join-request list for a group.
Approve or reject pending join requests.
Revoke the current invite code and return the new one.
Revoke a v4 invite for a specific invited user.
Update announcement or locked settings for a group.
Enable or disable disappearing messages for a group.
Update or clear the group description.
Set a custom label on a group member via the GROUP_MEMBER_LABEL_CHANGE protocol message.
Update the subject for an existing group.
Types
@type participant_result() :: %{ :jid => String.t(), :status => String.t(), optional(:content) => BaileysEx.BinaryNode.t() }
Functions
Accept a legacy invite code and return the joined group JID.
@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.
@spec add_participants(term(), String.t(), [String.t()]) :: {:ok, [participant_result()]} | {:error, term()}
Add participants to a group.
Create a new group and return the parsed group metadata.
@spec demote_participants(term(), String.t(), [String.t()]) :: {:ok, [participant_result()]} | {:error, term()}
Demote participants from admins.
@spec extract_group_metadata(BaileysEx.BinaryNode.t()) :: map()
Extract Baileys-aligned group metadata from a group IQ result node.
@spec fetch_all_participating( term(), keyword() ) :: {:ok, %{required(String.t()) => map()}} | {:error, term()}
Fetch all participating groups and optionally emit groups_update.
Resolve invite metadata for a code without joining.
Fetch interactive metadata for a group.
@spec handle_dirty_update(term(), %{type: String.t()}, keyword()) :: {:ok, %{required(String.t()) => map()}} | :ignore | {:error, term()}
Handle a dirty group/community update by refetching groups and cleaning the bucket.
Fetch the current invite code for a group.
Toggle join-approval mode for a group.
Leave a group.
Switch whether only admins or all members can add participants.
@spec promote_participants(term(), String.t(), [String.t()]) :: {:ok, [participant_result()]} | {:error, term()}
Promote participants to admins.
@spec remove_participants(term(), String.t(), [String.t()]) :: {:ok, [participant_result()]} | {:error, term()}
Remove participants from a group.
Fetch the pending join-request list for a group.
@spec request_participants_update( term(), String.t(), [String.t()], :approve | :reject ) :: {:ok, [participant_result()]} | {:error, term()}
Approve or reject pending join requests.
Revoke the current invite code and return the new one.
Revoke a v4 invite for a specific invited user.
@spec setting_update( term(), String.t(), :announcement | :not_announcement | :locked | :unlocked ) :: :ok | {:error, term()}
Update announcement or locked settings for a group.
@spec toggle_ephemeral(term(), String.t(), non_neg_integer()) :: :ok | {:error, term()}
Enable or disable disappearing messages for a group.
Update or clear the group description.
@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 the subject for an existing group.