Skip to content

Commit

Permalink
fix: avoid empty command
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrckd committed Sep 13, 2024
1 parent 853c8ab commit 5f07583
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/matrix_bot/eventparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def parse_command(self, commands: str | list[str], prefix: str, command_name: st
self.command = command

def is_command(self, prefix: str) -> bool:
return self.event.body.strip().startswith(prefix)
text = self.event.body.strip()
return text.startswith(prefix) and len(text) > 1

def get_command(self) -> list[str] | None:
return self.command
Expand Down

0 comments on commit 5f07583

Please sign in to comment.