diff --git a/src/matrix_bot/client.py b/src/matrix_bot/client.py index 2c22337..a66d377 100644 --- a/src/matrix_bot/client.py +++ b/src/matrix_bot/client.py @@ -48,7 +48,8 @@ class Client(Aobject): __sync_token_queue: asyncio.Queue[str] __invite_queue: asyncio.Queue[tuple[RoomId, nio.responses.InviteInfo]] __invite_policy: InvitePolicy - user: str + user_name: str + user_id: str async def __init__( self, @@ -87,6 +88,7 @@ class Client(Aobject): if isinstance(resp, nio.responses.LoginError): raise RuntimeError(f"Fail to connect: {resp.message}") log.info("logged in") + self.user_name = username self.user_id = self.__client.user_id async def resolve_room( @@ -292,7 +294,7 @@ class Client(Aobject): def add_message_callback( self, - callback: Callable[[Client, nio.rooms.Room, nio.events.room_events.RoomMessageText], Awaitable[None]] + callback: Callable[[Client, nio.rooms.MatrixRoom, nio.events.room_events.RoomMessageText], Awaitable[None]] ): """ Add a callback called when a message is received.