From 1d8fd0b836184204d040f19ba5cb8d9b9674a58b Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 11 Jan 2019 12:46:41 +0100 Subject: [PATCH] Make Filters.regex work on message captions too --- pyrogram/client/filters/filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index 77492c6a..c54960d3 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -287,7 +287,7 @@ class Filters: """ 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 create("Regex", f, p=re.compile(pattern, flags))