mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 18:01:04 +00:00
Disabled ContentTypesFilter by default (#668)
* Disabled ContentTypesFilter by default * Rename file * Update docs
This commit is contained in:
parent
5851e32266
commit
18a93aab60
6 changed files with 21 additions and 18 deletions
|
|
@ -15,11 +15,6 @@ Can be imported:
|
|||
|
||||
Or used from filters factory by passing corresponding arguments to handler registration line
|
||||
|
||||
.. warning::
|
||||
**Please be patient!**
|
||||
|
||||
If no one content type filter is specified the :code:`["text"]` value is automatically will be used.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ Filters can be:
|
|||
|
||||
- Subclass of :ref:`BaseFilter <filters-base>`
|
||||
|
||||
- Instances of :ref:`MagicFilter <magic-filters>`
|
||||
|
||||
Filters should return bool or dict.
|
||||
If the dictionary is passed as result of filter - resulted data will be propagated to the next
|
||||
filters and handler as keywords arguments.
|
||||
|
|
@ -70,4 +72,7 @@ For example if you need to make simple text filter:
|
|||
|
||||
.. note::
|
||||
|
||||
Bound filters is always recursive propagates to the nested routers.
|
||||
Bound filters is always recursive propagates to the nested routers but will be available
|
||||
in nested routers only after attaching routers so that's mean you will need to
|
||||
include routers before registering handlers.
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,19 @@ Update
|
|||
Message
|
||||
-------
|
||||
|
||||
|
||||
.. attention::
|
||||
|
||||
Be attentive with filtering this event
|
||||
|
||||
You should expect than this event can be with different set's of attributes in different cases
|
||||
|
||||
(For example text, sticker and document is always is different content types of message)
|
||||
|
||||
Recommended way to check field availability before usage or use
|
||||
:class:`aiogram.dispatcher.filters.content_types.ContentTypesFilter`
|
||||
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@router.message()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue