mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-16 12:07:13 +00:00
Change magic filter examples
This commit is contained in:
parent
f7af9e7f4a
commit
091b82e13f
1 changed files with 2 additions and 1 deletions
|
|
@ -53,6 +53,7 @@ Equals
|
||||||
|
|
||||||
F.text == 'hello' # lambda message: message.text == 'hello'
|
F.text == 'hello' # lambda message: message.text == 'hello'
|
||||||
F.from_user.id == 42 # lambda message: message.from_user.id == 42
|
F.from_user.id == 42 # lambda message: message.from_user.id == 42
|
||||||
|
F.text != 'spam' # lambda message: message.text != 'spam'
|
||||||
|
|
||||||
Is one of
|
Is one of
|
||||||
---------
|
---------
|
||||||
|
|
@ -104,7 +105,7 @@ Any of available operation can be inverted by bitwise inversion - :code:`~`
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
~(F.text == 'spam') # lambda message: message.text != 'spam'
|
~F.text # lambda message: not message.text
|
||||||
~F.text.startswith('spam') # lambda message: not message.text.startswith('spam')
|
~F.text.startswith('spam') # lambda message: not message.text.startswith('spam')
|
||||||
|
|
||||||
Combining
|
Combining
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue