From 75d00ea50ed1ae4ec3eaf1b3dc83fafe2d2782e5 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 18 May 2024 21:31:56 +0200 Subject: [PATCH] fix: correct user variable in invite error log Updated the logger to use `event.sender` instead of an undefined `user` variable when logging a failed space invitation, ensuring the correct information is logged. This change addresses a bug where the wrong variable was referenced, potentially causing confusion when diagnosing issues with space invites. --- src/gptbot/commands/space.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gptbot/commands/space.py b/src/gptbot/commands/space.py index fca09a0..8d8b1cb 100644 --- a/src/gptbot/commands/space.py +++ b/src/gptbot/commands/space.py @@ -120,7 +120,7 @@ async def command_space(room: MatrixRoom, event: RoomMessageText, bot): if isinstance(response, RoomInviteError): bot.logger.log( - f"Failed to invite user {user} to space {space}", "error") + f"Failed to invite user {event.sender} to space {space}", "error") await bot.send_message( room, "Sorry, I couldn't invite you to the space. Please try again later.", True) return