Overview
Baileys provides comprehensive methods for managing group participants, including adding/removing members and changing admin roles. Only group admins can perform these operations.Group Participants Update
The main method for managing participants isgroupParticipantsUpdate, which handles multiple actions.
Function Signature
jid- The group JIDparticipants- Array of participant JIDs to updateaction- One of:'add','remove','promote','demote', or'modify'
Adding Participants
Add new members to an existing group.Basic Example
Handling Results
Success Status: A status of
'200' indicates successful operation. Other codes indicate errors.Removing Participants
Remove members from the group.Safely Removing Participants
Promoting Participants
Promote regular members to admin status.Promote with Confirmation
Demoting Participants
Demote admins back to regular member status.Super Admin: The group creator (super admin) cannot be demoted. Attempting to demote the creator will fail.
Managing Join Requests
For groups with join approval mode enabled, you can approve or reject join requests.Get Join Request List
Approve/Reject Join Requests
Function Signature
Approve Requests
Reject Requests
Complete Join Request Handler
Participant Structure
Participants in group metadata have the following structure:Best Practices
1
Check admin status before operations
Verify you have admin permissions before attempting to modify participants.
2
Handle errors gracefully
Always check the status codes returned from participant updates.
3
Validate participant JIDs
Ensure JIDs are properly formatted before operations.
Common Use Cases
Batch Add with Error Handling
Automatic Admin Assignment
Related Methods
- Group Metadata - Fetch participant information
- Group Settings - Configure who can add members
- Invite Codes - Alternative way to add members