Rewrite filters

This commit is contained in:
Alex Root Junior 2022-08-14 21:43:33 +03:00
parent 3f57c69d4f
commit 8d2aae77c1
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
24 changed files with 311 additions and 539 deletions

View file

@ -3,7 +3,7 @@ Command
=======
.. autoclass:: aiogram.filters.command.Command
:members:
:members: __init__
:member-order: bysource
:undoc-members: False
@ -18,10 +18,10 @@ When filter is passed the :class:`aiogram.filters.command.CommandObject` will be
Usage
=====
1. Filter single variant of commands: :code:`Command(commands=["start"])` or :code:`Command(commands="start")`
2. Handle command by regexp pattern: :code:`Command(commands=[re.compile(r"item_(\d+)")])`
3. Match command by multiple variants: :code:`Command(commands=["item", re.compile(r"item_(\d+)")])`
4. Handle commands in public chats intended for other bots: :code:`Command(commands=["command"], commands_ignore_mention=True)`
1. Filter single variant of commands: :code:`Command("start")`
2. Handle command by regexp pattern: :code:`Command(re.compile(r"item_(\d+)"))`
3. Match command by multiple variants: :code:`Command("item", re.compile(r"item_(\d+)"))`
4. Handle commands in public chats intended for other bots: :code:`Command("command", ignore_mention=True)`
.. warning::