Fix indexes of capture groups
${{0}} now means the whole match and ${{1}} is the first capture group.
This commit is contained in:
parent
28d6b05913
commit
873cae5821
1 changed files with 2 additions and 1 deletions
|
@ -59,7 +59,8 @@ class Rule:
|
|||
|
||||
async def execute(self, evt: MessageEvent, match: Match) -> None:
|
||||
extra_vars = {
|
||||
**{str(i): val for i, val in enumerate(match.groups())},
|
||||
"0": match.group(0),
|
||||
**{str(i+1): val for i, val in enumerate(match.groups())},
|
||||
**match.groupdict(),
|
||||
}
|
||||
content = self.template.execute(evt=evt, rule_vars=self.variables, extra_vars=extra_vars)
|
||||
|
|
Loading…
Reference in a new issue