mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 01:54:53 +00:00
Implemented hashtag/cashtag filter
This commit is contained in:
parent
09293063d3
commit
0185af25c1
3 changed files with 74 additions and 4 deletions
|
|
@ -6,9 +6,8 @@ import time
|
|||
import typing
|
||||
from contextvars import ContextVar
|
||||
|
||||
from aiogram.dispatcher.filters import Command
|
||||
from .filters import ContentTypeFilter, ExceptionsFilter, FiltersFactory, RegexpCommandsFilter, \
|
||||
Regexp, StateFilter, Text
|
||||
from .filters import Command, ContentTypeFilter, ExceptionsFilter, FiltersFactory, HashTag, Regexp, \
|
||||
RegexpCommandsFilter, StateFilter, Text
|
||||
from .handler import Handler
|
||||
from .middlewares import MiddlewareManager
|
||||
from .storage import BaseStorage, DELTA, DisabledStorage, EXCEEDED_COUNT, FSMContext, \
|
||||
|
|
@ -93,6 +92,10 @@ class Dispatcher:
|
|||
self.channel_post_handlers, self.edited_channel_post_handlers,
|
||||
self.callback_query_handlers
|
||||
])
|
||||
filters_factory.bind(HashTag, event_handlers=[
|
||||
self.message_handlers, self.edited_message_handlers,
|
||||
self.channel_post_handlers, self.edited_channel_post_handlers
|
||||
])
|
||||
filters_factory.bind(Regexp, event_handlers=[
|
||||
self.message_handlers, self.edited_message_handlers,
|
||||
self.channel_post_handlers, self.edited_channel_post_handlers,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue