Log invite response

This commit is contained in:
Panoramic 2024-07-19 18:49:42 +03:00
parent a11a3ea2ac
commit 282dc8ed9e
1 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,7 @@ from nio import (
RoomGetEventError,
RoomMessageText,
UnknownEvent,
RoomInviteError,
)
from vetting_bot.bot_commands import Command
@ -213,7 +214,11 @@ class Callbacks:
# Invite the user
logger.info("Inviting new user (%s) to the main space.", row[0])
await self.client.room_invite(self.config.main_space_id, row[0])
resp = await self.client.room_invite(self.config.main_space_id, row[0])
if isinstance(resp, RoomInviteError):
logger.error(f"Failed inviting user: {resp}", stack_info=True)
else:
logger.info(f"Invited user: {resp}")
async def unknown(self, room: MatrixRoom, event: UnknownEvent) -> None:
"""Callback for when an event with a type that is unknown to matrix-nio is received.