fix: rename to ChatTypeFilter

This commit is contained in:
Egor 2020-06-14 17:32:18 +05:00
parent 7ae4f264fe
commit 006a5ef987
5 changed files with 8 additions and 8 deletions

View file

@ -11,7 +11,7 @@ from aiohttp.helpers import sentinel
from aiogram.utils.deprecated import renamed_argument
from .filters import Command, ContentTypeFilter, ExceptionsFilter, FiltersFactory, HashTag, Regexp, \
RegexpCommandsFilter, StateFilter, Text, IDFilter, AdminFilter, IsReplyFilter, ForwardedMessageFilter, \
IsSenderContact, ChatTypesFilter
IsSenderContact, ChatTypeFilter
from .handler import Handler
from .middlewares import MiddlewareManager
from .storage import BaseStorage, DELTA, DisabledStorage, EXCEEDED_COUNT, FSMContext, \
@ -166,7 +166,7 @@ class Dispatcher(DataMixin, ContextInstanceMixin):
self.channel_post_handlers,
self.edited_channel_post_handlers
])
filters_factory.bind(ChatTypesFilter, event_handlers=[
filters_factory.bind(ChatTypeFilter, event_handlers=[
self.message_handlers,
self.edited_message_handlers,
self.channel_post_handlers,

View file

@ -1,7 +1,7 @@
from .builtin import Command, CommandHelp, CommandPrivacy, CommandSettings, CommandStart, ContentTypeFilter, \
ExceptionsFilter, HashTag, Regexp, RegexpCommandsFilter, StateFilter, \
Text, IDFilter, AdminFilter, IsReplyFilter, IsSenderContact, ForwardedMessageFilter, \
ChatTypesFilter
ChatTypeFilter
from .factory import FiltersFactory
from .filters import AbstractFilter, BoundFilter, Filter, FilterNotPassed, FilterRecord, execute_filter, \
check_filters, get_filter_spec, get_filters_spec
@ -34,5 +34,5 @@ __all__ = [
'execute_filter',
'check_filters',
'ForwardedMessageFilter',
'ChatTypesFilter',
'ChatTypeFilter',
]

View file

@ -693,7 +693,7 @@ class ForwardedMessageFilter(BoundFilter):
return bool(getattr(message, "forward_date")) is self.is_forwarded
class ChatTypesFilter(BoundFilter):
class ChatTypeFilter(BoundFilter):
key = 'chat_types'
def __init__(self, chat_types: typing.List[ChatType]):

View file

@ -149,10 +149,10 @@ ForwardedMessageFilter
:show-inheritance:
ChatTypesFilter
ChatTypeFilter
-------------
.. autoclass:: aiogram.dispatcher.filters.filters.ChatTypesFilter
.. autoclass:: aiogram.dispatcher.filters.filters.ChatTypeFilter
:members:
:show-inheritance:

View file

@ -1,5 +1,5 @@
"""
This is an example with usage of ChatTypesFilter
This is an example with usage of ChatTypeFilter
It filters incoming object based on type of its chat type
"""