Skip to main content

Overview

Baileys provides methods to configure various group settings. Only group admins can modify these settings.

Announcement Mode

Control who can send messages in the group.

Function Signature

Enable Announcement Mode

Only allow admins to send messages.
When announcement mode is enabled, regular members cannot send messages. Only admins can post to the group.

Disable Announcement Mode

Allow everyone to send messages.

Locked Settings

Control who can modify group settings like the display picture, name, and description.

Lock Group Settings

Only allow admins to modify group settings.
When locked, only admins can change the group’s display picture, name, description, and other settings.

Unlock Group Settings

Allow everyone to modify group settings.
When unlocked, any member can change the group picture, name, and description. This may lead to unwanted modifications.

Group Subject (Name)

Update the group’s name.

Function Signature

Update Group Name

Example with Validation

Group Description

Update the group’s description.

Function Signature

Set Description

Remove Description

Pass undefined or an empty string to remove the description.

Complete Example

The implementation automatically handles the previous description ID (descId) by fetching current metadata. This ensures proper description versioning.

Member Add Mode

Control who can add new members to the group.

Function Signature

Only Admins Can Add

All Members Can Add

Example Toggle Function

Join Approval Mode

Control whether join requests require admin approval.

Function Signature

Enable Join Approval

Disable Join Approval

When join approval is enabled, users who click the invite link will need to request to join, and admins must approve them using groupRequestParticipantsUpdate.

Ephemeral Messages (Disappearing Messages)

Enable or disable disappearing messages for the group.

Function Signature

Ephemeral Durations

Enable Ephemeral Messages

Disable Ephemeral Messages

Helper Function

Leave Group

Leave a group you’re a member of.

Function Signature

Leave a Group

This action is irreversible. You’ll need to be re-invited to rejoin the group.

Safe Leave Function

Complete Settings Configuration

Example of configuring multiple group settings:
1

Lock down the group

2

Open group settings

3

Configure privacy settings

Best Practices

Check Admin Status: Always verify you have admin permissions before attempting to modify settings.
Sequential Updates: When making multiple setting changes, execute them sequentially to ensure each completes successfully.
Rate Limiting: Avoid making too many rapid setting changes. WhatsApp may rate-limit your requests.

Error Handling Pattern