TheDocumentation Index
Fetch the complete documentation index at: https://whatsapp-rust.jlucaso.com/llms.txt
Use this file to discover all available pages before exploring further.
Community feature provides methods for managing WhatsApp communities, including creation, subgroup linking/unlinking, and metadata queries. Community mutations use IQ stanzas (w:g2 namespace) while metadata queries use MEX (GraphQL).
Access
Access community operations through the client:Methods
create
Create a new community.options— Community creation options (see CreateCommunityOptions)
CreateCommunityResult— Contains thegid(JID) of the created community
If a description is provided, it is set via a follow-up IQ after creation — the group create stanza does not support inline descriptions for communities.
deactivate
Deactivate (delete) a community. Subgroups are unlinked but not deleted.community_jid— JID of the community to deactivate
link_subgroups
Link existing groups as subgroups of a community.community_jid— JID of the parent communitysubgroup_jids— Array of group JIDs to link
LinkSubgroupsResult— Containslinked_jids(successfully linked) andfailed_groups(JID + error code pairs)
unlink_subgroups
Unlink subgroups from a community.community_jid— JID of the parent communitysubgroup_jids— Array of subgroup JIDs to unlinkremove_orphan_members— Whether to remove members who are only in the community through the unlinked subgroups
UnlinkSubgroupsResult— Containsunlinked_jids(successfully unlinked) andfailed_groups(JID + error code pairs)
get_subgroups
Fetch all subgroups of a community via MEX (GraphQL).community_jid— JID of the community
Vec<CommunitySubgroup>— List of subgroups with metadata
get_subgroup_participant_counts
Fetch participant counts per subgroup via MEX (GraphQL).community_jid— JID of the community
Vec<(Jid, u32)>— Pairs of subgroup JID and participant count
query_linked_group
Query a linked subgroup’s metadata from the parent community.community_jid— JID of the parent communitysubgroup_jid— JID of the subgroup to query
GroupMetadata— Full group metadata (see Groups API)
join_subgroup
Join a linked subgroup via the parent community.community_jid— JID of the parent communitysubgroup_jid— JID of the subgroup to join
GroupMetadata— Metadata of the joined subgroup
get_linked_groups_participants
Get all participants across all linked groups of a community.community_jid— JID of the community
Vec<GroupParticipant>— List of participants across all subgroups
Types
CreateCommunityOptions
Options for creating a new community. ImplementsPartialEq and Eq.
name— Community namedescription— Optional description (set via follow-up IQ)closed— Whether the community requires approval to join (default:false)allow_non_admin_sub_group_creation— Whether non-admin members can create subgroups (default:false)create_general_chat— Whether to create a general chat subgroup (default:true)
CreateCommunityResult
Result of creating a community. ImplementsPartialEq and Eq.
CommunitySubgroup
A subgroup within a community. ImplementsPartialEq and Eq.
id— Subgroup JIDsubject— Subgroup nameparticipant_count— Number of participants (if available)is_default_sub_group— Whether this is the default announcement subgroupis_general_chat— Whether this is the general chat subgroup
LinkSubgroupsResult
Result of linking subgroups to a community. ImplementsPartialEq and Eq.
UnlinkSubgroupsResult
Result of unlinking subgroups from a community. ImplementsPartialEq and Eq.
GroupType
Classification of a group within the community hierarchy. ImplementsPartialEq and Eq.
GroupType is #[non_exhaustive], so match statements should include a wildcard arm to handle future variants.
Variants:
Default— Regular standalone groupCommunity— Community parent groupLinkedSubgroup— A subgroup linked to a communityLinkedAnnouncementGroup— The default announcement subgroup of a communityLinkedGeneralGroup— The general chat subgroup of a community
group_type() function to classify a group:
Error handling
Mutation methods (create, deactivate, link_subgroups, unlink_subgroups, query_linked_group, join_subgroup, get_linked_groups_participants) return anyhow::Error.
MEX-based query methods (get_subgroups, get_subgroup_participant_counts) return MexError: