Make Filters.regex work on message captions too

This commit is contained in:
Dan 2019-01-11 12:46:41 +01:00
parent 07276e31b9
commit 1d8fd0b836

View File

@ -287,7 +287,7 @@ class Filters:
""" """
def f(_, m): def f(_, m):
m.matches = [i for i in _.p.finditer(m.text or "")] m.matches = [i for i in _.p.finditer(m.text or m.caption or "")]
return bool(m.matches) return bool(m.matches)
return create("Regex", f, p=re.compile(pattern, flags)) return create("Regex", f, p=re.compile(pattern, flags))