SDKsHarmonyOSEnterprise
Change group mute status
Enable or disable group-wide muting, with optional bypass exemptions for designated members.
Toggle group-wide mute to restrict regular members from sending messages. The muteBypassUserIDs array specifies whitelist members who retain speaking privileges during group mute:
Code example
import sdk, { ChangeGroupMuteReq } from '@openimsdk/imsdk';
const request: ChangeGroupMuteReq = {
groupID: groupID,
mute: true,
muteBypassUserIDs: ['user_002'],
};
await sdk.changeGroupMute(request);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | Target group identifier. |
mute | boolean | Yes | Set to true to enable group-wide muting; set to false to lift the mute. |
muteBypassUserIDs | string[] | Yes | List of user IDs exempt from the group mute. Pass [] if there are no exemptions. |
Return value
Returns a Promise that resolves to void upon updating the mute state on the server.
State changes after the call
Resolving the Promise confirms that the request reached the server. When EventOnGroupInfoChanged arrives, update local group state keyed by groupID. For complete event listening, see Group overview. To verify active settings immediately, see Retrieve specified group profiles.
Was this page helpful?