fix: Fixes room alias resolution error handling
Ensures room ID is returned only if present in the response Improves reliability by returning the alias if resolution fails
This commit is contained in:
parent
ee94d66737
commit
93de30baac
1 changed files with 6 additions and 1 deletions
|
@ -138,7 +138,12 @@ class RoombaBot:
|
|||
Returns:
|
||||
str: The room ID of the resolved room alias.
|
||||
"""
|
||||
return await self.client.room_resolve_alias(room_alias)
|
||||
response = await self.client.room_resolve_alias(room_alias)
|
||||
|
||||
if response and "room_id" in response:
|
||||
return response["room_id"]
|
||||
|
||||
return room_alias
|
||||
|
||||
async def block_room(self, room_id, block):
|
||||
"""Block or unblock a room.
|
||||
|
|
Loading…
Reference in a new issue