docs: async def create_room(self, alias: Optional[str] = None, is_public: bool = False,
                            name: Optional[str] = None, topic: Optional[str] = None,
                            is_direct: bool = False, invitees: Optional[List[str]] = None,
                            initial_state: Optional[List[dict]] = None) -> str:
          """
          Create a new room. See also: `API reference`_
  
          Args:
              alias: The desired room alias **local part**. If this is included, a room alias will be
                  created and mapped to the newly created room. The alias will belong on the same
                  homeserver which created the room. For example, if this was set to "foo" and sent to
                  the homeserver "example.com" the complete room alias would be ``#foo:example.com``.
              is_public: This flag sets the state event preset to ``public_chat``, which sets
                  ``join_rules`` to ``public``. Defaults to false, which sets ``join_rules`` to
                  ``invite``.
              name: If this is included, an ``m.room.name`` event will be sent into the room to
                  indicate the name of the room. See `Room Events`_ for more information on
                  ``m.room.name``.
              topic: If this is included, an ``m.room.topic`` event will be sent into the room to
                  indicate the topic for the room. See `Room Events`_ for more information on
                  ``m.room.topic``.
              is_direct: This flag makes the server set the ``is_direct`` flag on the
                  ``m.room.member`` events sent to the users in ``invite`` and ``invite_3pid``. See
                  `Direct Messaging`_ for more information.
              invitees: A list of user IDs to invite to the room. This will tell the server to invite
                  everyone in the list to the newly created room.
              initial_state: A list of state events to set in the new room. This allows the user to
                  override the default state events set in the new room. The expected format of the
                  state events are an object with type, state_key and content keys set.
  
                  Takes precedence over events set by `is_public`, but gets overriden by ``name`` and
                  ``topic keys``.
  
          Returns:
              The ID of the newly created room.
  
          Raises:
              MatrixResponseError: If the response does not contain a ``room_id`` field.
  
          .. _API reference:
             https://matrix.org/docs/spec/client_server/r0.3.0.html#post-matrix-client-r0-createroom
          .. _Room Events:
             https://matrix.org/docs/spec/client_server/r0.3.0.html#room-events
          .. _Direct Messaging:
             https://matrix.org/docs/spec/client_server/r0.3.0.html#direct-messaging
          """
          await self.ensure_registered()
          content = {
              "visibility": "private",
              "is_direct": is_direct,
              "preset": "public_chat" if is_public else "private_chat",
          }
          if alias:
              content["room_alias_name"] = alias
          if invitees:
              content["invite"] = invitees
          if name:
              content["name"] = name
          if topic:
              content["topic"] = topic
          if initial_state:
              content["initial_state"] = initial_state
  
          resp = await self.client.request("POST", "/createRoom", content)
          try:
              return resp["room_id"]
          except KeyError:
              raise MatrixResponseError("Room create response did not contain room_id.")