Skip to content

Commit 9ac7541

Browse files
committed
Fix room get name
1 parent b2d9ca9 commit 9ac7541

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "recnetpy"
7-
version = "0.2.65"
7+
version = "0.2.66"
88
authors = [
99
{ name="RecNetBot Development"}
1010
]

src/recnetpy/managers/room_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ async def get(self, name: str, include: int = 0) -> 'Room':
3535
:param include: An integer that add additional information to the response.
3636
:return: An room object representing the data or nothing if not found.
3737
"""
38-
data: 'Response[RoomResponse]' = await self.rec_net.rooms.make_request('get', params = {'name': name, 'include': include})
39-
if data.success: return self.create_dataclass(data.data['RoomId'], data.data)
38+
data: 'Response[RoomResponse]' = await self.rec_net.rooms.bulk.make_request('get', params = {'name': name})
39+
room_data = data.data[0]
40+
if data.success and data.data: return self.create_dataclass(room_data['RoomId'], room_data)
4041
return None
4142

4243
async def fetch(self, id: int, include: int = 0) -> 'Room':

0 commit comments

Comments
 (0)