diff --git a/telebot/asyncio_filters.py b/telebot/asyncio_filters.py index 312b290..c594d31 100644 --- a/telebot/asyncio_filters.py +++ b/telebot/asyncio_filters.py @@ -10,8 +10,12 @@ class SimpleCustomFilter(ABC): Simple Custom Filter base class. Create child class with check() method. Accepts only message, returns bool value, that is compared with given in handler. + + Child classes should have .key property. """ + key: str = None + async def check(self, message): """ Perform a check. @@ -26,8 +30,12 @@ class AdvancedCustomFilter(ABC): Accepts two parameters, returns bool: True - filter passed, False - filter failed. message: Message class text: Filter value given in handler + + Child classes should have .key property. """ + key: str = None + async def check(self, message, text): """ Perform a check. diff --git a/telebot/custom_filters.py b/telebot/custom_filters.py index 1bd80b3..abeffdd 100644 --- a/telebot/custom_filters.py +++ b/telebot/custom_filters.py @@ -12,8 +12,12 @@ class SimpleCustomFilter(ABC): Simple Custom Filter base class. Create child class with check() method. Accepts only message, returns bool value, that is compared with given in handler. + + Child classes should have .key property. """ + key: str = None + def check(self, message): """ Perform a check. @@ -28,8 +32,12 @@ class AdvancedCustomFilter(ABC): Accepts two parameters, returns bool: True - filter passed, False - filter failed. message: Message class text: Filter value given in handler + + Child classes should have .key property. """ + key: str = None + def check(self, message, text): """ Perform a check.