fix(bot): normalize mention case for command handling
Ensure that the bot commands are recognized regardless of the letter casing of the mention. This improves command compatibility and user experience by allowing flexibility in how the bot is invoked. Prior to this change, commands were case-sensitive, potentially leading to inconsistencies in command recognition.
This commit is contained in:
parent
9c514cd9cd
commit
f491c8be41
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ class ApplicationBot:
|
||||||
body = event.body if hasattr(event, "body") else None
|
body = event.body if hasattr(event, "body") else None
|
||||||
|
|
||||||
if body:
|
if body:
|
||||||
mention = body.split()[0]
|
mention = body.split()[0].lower()
|
||||||
if mention == "!applicationbot" or mention in self.username:
|
if mention == "!applicationbot" or mention in self.username:
|
||||||
return await self.handle_command(room, sender, body.split(" ", 1)[1])
|
return await self.handle_command(room, sender, body.split(" ", 1)[1])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue