small changes
This commit is contained in:
parent
139b9e138b
commit
b9f87bf42f
1 changed files with 4 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue