Update command.rst

Fix rendition of the backslash in regular expressions
This commit is contained in:
Alexey Leshchenko 2024-04-24 09:54:42 +03:00 committed by GitHub
parent f1c9fc50f0
commit 9226f70f1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,8 +6,8 @@ Usage
=====
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+)"))`
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)`
5. Use :class:`aiogram.types.bot_command.BotCommand` object as command reference :code:`Command(BotCommand(command="command", description="My awesome command")`