mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Remove filters factory, introduce docs translation (#978)
* Rewrite filters * Update README.rst * Fixed tests * Small optimization of the Text filter (TY to @bomzheg) * Remove dataclass slots argument in due to the only Python 3.10 has an slots argument * Fixed mypy * Update tests * Disable Python 3.11 * Fixed #1013: Empty mention should be None instead of empty string. * Added #990 to the changelog * Added #942 to the changelog * Fixed coverage * Update poetry and dependencies * Fixed mypy * Remove deprecated code * Added more tests, update pyproject.toml * Partial update docs * Added initial Docs translation files * Added more changes * Added log message when connection is established in polling process * Fixed action * Disable lint for PyPy * Added changelog for docs translation
This commit is contained in:
parent
94030903ec
commit
f4251382e8
610 changed files with 61738 additions and 1687 deletions
|
|
@ -44,8 +44,8 @@ Message
|
|||
|
||||
(For example text, sticker and document are always of different content types of message)
|
||||
|
||||
Recommended way to check field availability before usage or use
|
||||
:class:`aiogram.filters.content_types.ContentTypesFilter`
|
||||
Recommended way to check field availability before usage, for example via :ref:`magic filter <magic-filters>`:
|
||||
:code:`F.text` to handle text, :code:`F.sticker` to handle stickers only and etc.
|
||||
|
||||
|
||||
.. code-block:: python
|
||||
|
|
@ -141,7 +141,7 @@ Errors
|
|||
.. code-block:: python
|
||||
|
||||
@router.errors()
|
||||
async def error_handler(exception: Exception) -> Any: pass
|
||||
async def error_handler(exception: ErrorEvent) -> Any: pass
|
||||
|
||||
Is useful for handling errors from other handlers
|
||||
|
||||
|
|
@ -152,9 +152,8 @@ Nested routers
|
|||
.. warning::
|
||||
|
||||
Routers by the way can be nested to an another routers with some limitations:
|
||||
|
||||
1. Router **CAN NOT** include itself
|
||||
1. Routers **CAN NOT** be used for circular including (router 1 include router 2, router 2 include router 3, router 3 include router 1)
|
||||
1. Router **CAN NOT** include itself
|
||||
1. Routers **CAN NOT** be used for circular including (router 1 include router 2, router 2 include router 3, router 3 include router 1)
|
||||
|
||||
|
||||
Example:
|
||||
|
|
@ -170,7 +169,7 @@ Example:
|
|||
|
||||
|
||||
.. code-block:: python
|
||||
:caption: module_12.py
|
||||
:caption: module_2.py
|
||||
:name: module_1
|
||||
|
||||
from module_2 import router2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue