Backward compatibility - implemented 'func' filter

This commit is contained in:
Alex Root Junior 2018-10-28 17:42:21 +02:00
parent 42913389c0
commit 21908739e9
3 changed files with 23 additions and 2 deletions

View file

@ -5,7 +5,7 @@ import logging
import time
import typing
from .filters import Command, ContentTypeFilter, ExceptionsFilter, FiltersFactory, HashTag, Regexp, \
from .filters import Command, ContentTypeFilter, ExceptionsFilter, FiltersFactory, FuncFilter, HashTag, Regexp, \
RegexpCommandsFilter, StateFilter, Text
from .handler import Handler
from .middlewares import MiddlewareManager
@ -108,6 +108,9 @@ class Dispatcher(DataMixin, ContextInstanceMixin):
filters_factory.bind(ExceptionsFilter, event_handlers=[
self.errors_handlers
])
filters_factory.bind(FuncFilter, exclude_event_handlers=[
self.errors_handlers
])
def __del__(self):
self.stop_polling()