Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app x

Mute or unmute a group member

Mute or unmute a specific group member for a specified duration.

Copy

Invoke changeGroupMemberMute() to mute or unmute a specific group member.

Parameters

ParameterTypeRequiredDescription
groupIDstringYesTarget group identifier.
userIDstringYesTarget member user ID.
mutedSecondsnumberYesMute duration in seconds; pass 0 to lift the mute.

The group owner can mute administrators and regular members; administrators can mute only regular members. Final permissions are authoritatively enforced by OpenIMServer.

Code example

import { changeGroupMemberMute } from '@/uni_modules/unix-openim-sdk'

await changeGroupMemberMute({
  groupID: groupID,
  userID: targetUserID,
  mutedSeconds: 3600,
})

Return value

The Promise resolves with void once OpenIMServer updates the member mute duration.

State changes after the call

A resolved Promise confirms that the request completed on the server. The member's final mute state is determined by the muteEndTime Unix timestamp in their member profile rather than local seconds calculations. Connected clients receive onGroupMemberInfoChanged, at which point the UI updates the member's mute expiration matching groupID:userID. For complete member event handling, see Get group member list.