mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
Fix contains to check if text contains everything from list
instead of just something
This commit is contained in:
parent
1a9a11f3fd
commit
a057558ecd
1 changed files with 1 additions and 1 deletions
|
|
@ -274,7 +274,7 @@ class Text(Filter):
|
|||
return text in self.equals
|
||||
elif self.contains is not None:
|
||||
self.contains = list(map(lambda s: str(s).lower() if self.ignore_case else str(s), self.contains))
|
||||
return any(map(text.__contains__, self.contains))
|
||||
return all(map(text.__contains__, self.contains))
|
||||
elif self.startswith is not None:
|
||||
self.startswith = list(map(lambda s: str(s).lower() if self.ignore_case else str(s), self.startswith))
|
||||
return any(map(text.startswith, self.startswith))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue