Skip to content

Commit

Permalink
Merge pull request maubot#72 from L0ric0/master
Browse files Browse the repository at this point in the history
fix start and end positions of match in RegexArgument
  • Loading branch information
tulir authored Oct 23, 2019
2 parents 6082a47 + 2d1560e commit 6f37f91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maubot/handlers/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def match(self, val: str, **kwargs) -> Tuple[str, Any]:
val = val.split(" ")[0]
match = self.regex.match(val)
if match:
return (orig_val[:match.pos] + orig_val[match.endpos:],
match.groups() or val[match.pos:match.endpos])
return (orig_val[:match.start()] + orig_val[match.end():],
match.groups() or val[match.start():match.end()])
return orig_val, None


Expand Down

0 comments on commit 6f37f91

Please sign in to comment.