muteAllMembers method

Future<void> muteAllMembers(
  1. String groupId
)

~english Mutes all group members. Only the group owner and admins can call this method.

Param groupId The group ID.

Returns None.

Throws Exception description, see EMError. ~end

~chinese 设置全员禁言。 仅群主和管理员有权限调用。

Param groupId 群组 ID。

Return 无。

Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 EMError. ~end

Implementation

Future<void> muteAllMembers(String groupId) async {
  try {
    Map req = {'groupId': groupId};
    Map result = await Client.instance.groupManager
        .callNativeMethod(ChatMethodKeys.muteAllMembers, req);
    EMError.hasErrorFromResult(result);
  } catch (e) {
    rethrow;
  }
}