fix: lost validate method

This commit is contained in:
Ilya Smirnov 2021-07-08 21:19:57 +03:00
parent 72b416c8bf
commit 828a30af21

View file

@ -293,6 +293,12 @@ class Text(Filter):
self.startswith = startswith
self.ignore_case = ignore_case
@classmethod
def validate(cls, full_config: Dict[str, Any]):
for param, key in cls._default_params:
if param in full_config:
return {key: full_config.pop(param)}
async def check(self, obj: Union[Message, CallbackQuery, InlineQuery, Poll]):
if isinstance(obj, Message):
text = obj.text or obj.caption or ''