From bdf688d36136a12a99dfaaf4f6127252938e1bee Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Fri, 20 Aug 2021 02:26:33 +0300 Subject: [PATCH] Update docs --- docs/dispatcher/filters/content_types.rst | 5 ----- docs/dispatcher/filters/index.rst | 7 ++++++- docs/dispatcher/router.rst | 13 +++++++++++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/docs/dispatcher/filters/content_types.rst b/docs/dispatcher/filters/content_types.rst index 639f2996..c28e6b8a 100644 --- a/docs/dispatcher/filters/content_types.rst +++ b/docs/dispatcher/filters/content_types.rst @@ -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 ===== diff --git a/docs/dispatcher/filters/index.rst b/docs/dispatcher/filters/index.rst index 010cb0c5..1b970d86 100644 --- a/docs/dispatcher/filters/index.rst +++ b/docs/dispatcher/filters/index.rst @@ -37,6 +37,8 @@ Filters can be: - Subclass of :ref:`BaseFilter ` +- Instances of :ref:`MagicFilter ` + 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. + diff --git a/docs/dispatcher/router.rst b/docs/dispatcher/router.rst index 3e1a1b69..ea13eea7 100644 --- a/docs/dispatcher/router.rst +++ b/docs/dispatcher/router.rst @@ -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()