mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Rewrite filters
This commit is contained in:
parent
3f57c69d4f
commit
8d2aae77c1
24 changed files with 311 additions and 539 deletions
|
|
@ -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::
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue