Community-management helpers mapped from Baileys' communities.ts.
Summary
Functions
Accept a legacy invite code and return the joined community JID.
Accept a v4 invite and emit the same post-join side effects Baileys performs.
Create a new community and return the created metadata when the follow-up metadata fetch succeeds.
Create a linked subgroup inside a community.
Extract Baileys-aligned community metadata from a community IQ result node.
Fetch all participating communities and optionally emit a groups_update event.
Fetch all linked groups for a community or subgroup JID.
Fetch the metadata associated with an invite code without joining.
Handle a dirty community update by refetching communities and cleaning the groups dirty bucket.
Fetch the current invite code for a community.
Toggle join-approval mode for a community.
Leave a community.
Link an existing subgroup into a community.
Switch whether only admins or all members can add participants.
Fetch interactive metadata for a community.
Add, remove, promote, or demote participants in a community.
Fetch the pending membership-approval request list for a community.
Approve or reject pending community membership 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 community.
Enable or disable disappearing messages for a community.
Unlink a subgroup from a community.
Update or clear the community description.
Update the subject for an existing community.
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 community 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.
@spec create(term(), String.t(), String.t() | nil, keyword()) :: {:ok, map() | nil} | {:error, term()}
Create a new community and return the created metadata when the follow-up metadata fetch succeeds.
@spec create_group(term(), String.t(), [String.t()], String.t(), keyword()) :: {:ok, map() | nil} | {:error, term()}
Create a linked subgroup inside a community.
@spec extract_metadata(BaileysEx.BinaryNode.t()) :: map()
Extract Baileys-aligned community metadata from a community IQ result node.
@spec fetch_all_participating( term(), keyword() ) :: {:ok, %{required(String.t()) => map()}} | {:error, term()}
Fetch all participating communities and optionally emit a groups_update event.
@spec fetch_linked_groups(term(), String.t()) :: {:ok, %{community_jid: String.t(), is_community: boolean(), linked_groups: [map()]}} | {:error, term()}
Fetch all linked groups for a community or subgroup JID.
Fetch the metadata associated with an invite code without joining.
@spec handle_dirty_update(term(), %{type: String.t()}, keyword()) :: {:ok, %{required(String.t()) => map()}} | :ignore | {:error, term()}
Handle a dirty community update by refetching communities and cleaning the groups dirty bucket.
Fetch the current invite code for a community.
Toggle join-approval mode for a community.
Leave a community.
Link an existing subgroup into a community.
Switch whether only admins or all members can add participants.
Fetch interactive metadata for a community.
@spec participants_update( term(), String.t(), [String.t()], :add | :remove | :promote | :demote ) :: {:ok, [participant_result()]} | {:error, term()}
Add, remove, promote, or demote participants in a community.
Fetch the pending membership-approval request list for a community.
@spec request_participants_update( term(), String.t(), [String.t()], :approve | :reject ) :: {:ok, [participant_result()]} | {:error, term()}
Approve or reject pending community membership 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 community.
@spec toggle_ephemeral(term(), String.t(), non_neg_integer()) :: :ok | {:error, term()}
Enable or disable disappearing messages for a community.
Unlink a subgroup from a community.
Update or clear the community description.
Update the subject for an existing community.