mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-06 07:50:32 +00:00
* Extend MagicFilter with aiogram-specific operation * Added tests * Added changes annotation and update docs
13 lines
376 B
Gherkin
13 lines
376 B
Gherkin
Added new custom operation for MagicFilter named :code:`as_`
|
|
|
|
Now you can use it to get magic filter result as handler argument
|
|
|
|
.. code-block:: python
|
|
|
|
from aiogram import F
|
|
|
|
...
|
|
|
|
@router.message(F.text.regexp(r"^(\d+)$").as_("digits"))
|
|
async def any_digits_handler(message: Message, digits: Match[str]):
|
|
await message.answer(html.quote(str(digits)))
|