muteChatRoomMembers method

Future<void> muteChatRoomMembers(
  1. String roomId,
  2. List<String> muteMembers,
  3. {int duration = -1}
)

禁止聊天室成员发言。

仅聊天室所有者和管理员可调用此方法。

Param roomId 聊天室 ID。

Param muteMembers 禁言的用户列表。

Param duration 禁言时长,单位是毫秒。

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

Implementation

Future<void> muteChatRoomMembers(
  String roomId,
  List<String> muteMembers, {
  int duration = -1,
}) async {
  Map req = {
    "roomId": roomId,
    "muteMembers": muteMembers,
    "duration": duration
  };
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.muteChatRoomMembers, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}