Update command.rst (#1470)

Fix rendition of the backslash in regular expressions
This commit is contained in:
Alexey Leshchenko 2024-04-24 22:38:26 +03:00 committed by GitHub
parent 6ad287c329
commit 849482da1f
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")`