mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fix regexp filter (Thanks to @Oleg_Oleg_Oleg).
This commit is contained in:
parent
190d68b1b6
commit
83847a9ab8
1 changed files with 2 additions and 2 deletions
|
|
@ -69,11 +69,11 @@ class CommandsFilter(AsyncFilter):
|
|||
|
||||
class RegexpFilter(Filter):
|
||||
def __init__(self, regexp):
|
||||
self.regexp = re.compile(regexp)
|
||||
self.regexp = re.compile(regexp, flags=re.IGNORECASE | re.MULTILINE)
|
||||
|
||||
def check(self, message):
|
||||
if message.text:
|
||||
return bool(self.regexp.match(message.text))
|
||||
return bool(self.regexp.search(message.text))
|
||||
|
||||
|
||||
class ContentTypeFilter(Filter):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue