fix(bot): handle whitespace in command input
Updated the command parser to correctly process non-empty inputs by checking if the event body contains a command, even with leading or trailing spaces. This prevents misinterpretations of valid commands with extra spaces and ensures the bot responds appropriately.
This commit is contained in:
parent
68bf718285
commit
3c08c748b4
1 changed files with 1 additions and 1 deletions
|
@ -90,7 +90,7 @@ class RoombaBot:
|
|||
|
||||
room_id = parts[2]
|
||||
await self.shutdown_room(room_id, purge)
|
||||
elif event.body.startswith("!roomba "):
|
||||
elif event.body and event.body.split()[0] == "!roomba":
|
||||
await self.send_message(
|
||||
self.moderation_room_id,
|
||||
"Unknown command. Use '!roomba block <room_id>', '!roomba unblock <room_id>', or '!roomba shutdown <room_id> [--purge]'.",
|
||||
|
|
Loading…
Reference in a new issue