# Room

### Join a room

```cpp
joinRoomById(std::string roomId)
```

Parameters:

| Name   | Type   | Description     | Required |
| ------ | ------ | --------------- | -------- |
| roomId | string | Room\_id string | true     |

### Create a room

```cpp
createRoom(RoomVisibility v,
                            std::optional<std::string> name = {},
                            std::optional<std::string> alias = {},
                            immer::array<std::string> invite = {},
                            std::optional<bool> isDirect = {},
                            bool allowFederate = true,
                            std::optional<std::string> topic = {},
                            JsonWrap powerLevelContentOverride = json::object())
```

### Get room information

```cpp
Room room(std::string id)
```

Parameters:

| Name   | Type   | Description    | Required |
| ------ | ------ | -------------- | -------- |
| roomId | string | room ID string | true     |

### Invite user to a room

```cpp
Room::invite(std::string userId)
```

Parameters:

| Name   | Type   | Description   | Required |
| ------ | ------ | ------------- | -------- |
| userId | string | userId string | true     |

### Leave a room

```cpp
Room::leave()
```

### Change room name

```cpp
Room::setName(std::string name)
```

Parameters:

| Name | Type   | Description      | Required |
| ---- | ------ | ---------------- | -------- |
| name | string | Room name string | true     |
