From d847484b5cb6423ea3375c2b148b7539c21c472d Mon Sep 17 00:00:00 2001 From: Kumi Date: Tue, 12 Nov 2024 21:34:26 +0100 Subject: [PATCH] fix(bot): ensure correct username parsing for mentions Adjusted mention handling logic to split the username at the colon, ensuring correct comparison for command processing. This prevents false positives when the username contains additional information post-colon. --- src/matrix_applicationbot/classes/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix_applicationbot/classes/bot.py b/src/matrix_applicationbot/classes/bot.py index f3b6ead..6cefc8d 100644 --- a/src/matrix_applicationbot/classes/bot.py +++ b/src/matrix_applicationbot/classes/bot.py @@ -65,7 +65,7 @@ class ApplicationBot: if body: mention = body.split()[0].lower() - if mention == "!applicationbot" or mention in self.username: + if mention == "!applicationbot" or mention in self.username.split(":")[0]: return await self.handle_command(room, sender, body.split(" ", 1)[1]) if body and body.startswith("!apply") and not sender == self.client.user_id: