fix: Enhances alias resolution with type check
Replaces a dictionary key existence check with an instance check, ensuring the response is of the expected type RoomResolveAliasResponse. This improves robustness by relying on a concrete type instead of assuming dictionary structure.
This commit is contained in:
parent
93de30baac
commit
27930603a5
1 changed files with 2 additions and 2 deletions
|
@ -140,8 +140,8 @@ class RoombaBot:
|
|||
"""
|
||||
response = await self.client.room_resolve_alias(room_alias)
|
||||
|
||||
if response and "room_id" in response:
|
||||
return response["room_id"]
|
||||
if isinstance(response, nio.RoomResolveAliasResponse):
|
||||
return response.room_id
|
||||
|
||||
return room_alias
|
||||
|
||||
|
|
Loading…
Reference in a new issue