From b9f87bf42fac665c2d67ff9579715b308ebf0244 Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Fri, 8 Oct 2021 16:40:40 +0200 Subject: [PATCH] small changes --- src/matrix_bot/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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.