addChatRoomAdmin method

Future<void> addChatRoomAdmin(
  1. String roomId,
  2. String admin
)

~english Adds a chat room admin.

Only the chat room owner can call this method.

Param roomId The chat room ID.

Param admin The ID of the chat room admin to be added.

Throws A description of the exception. See ChatError. ~end

~chinese 添加聊天室管理员。

仅聊天室所有者可调用此方法。

Param roomId 聊天室 ID。

Param admin 要设置的管理员 ID。

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

Implementation

Future<void> addChatRoomAdmin(
  String roomId,
  String admin,
) async {
  Map req = {"roomId": roomId, "admin": admin};
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.addChatRoomAdmin, req);
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}