Skip to content

Commit

Permalink
improve raw_pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick80835 committed Oct 3, 2020
1 parent 5023c00 commit cff9bd8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ubot/command_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ async def handle_outgoing(self, event):
pattern_match = search(self.pattern_template.format(prefix, command.pattern, command.pattern_extra), event.raw_text)

if pattern_match:
if command.raw_pattern:
event.command = command.pattern
else:
event.command = pattern_match.groups()[1]
event.args = pattern_match.groups()[-1].strip()
event.other_args = pattern_match.groups()[2:-1]

event.pattern_match = pattern_match
event.args = pattern_match.groups()[-1].strip()
event.other_args = pattern_match.groups()[2:-1]
event.command = pattern_match.groups()[1]
event.extra = command.extra
event.object = command

Expand Down

0 comments on commit cff9bd8

Please sign in to comment.