mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Add incoming and outgoing filters
This commit is contained in:
parent
3e4135c8e1
commit
e22f7896f8
@ -32,6 +32,12 @@ class Filters:
|
|||||||
"""This class provides access to all Filters available in Pyrogram.
|
"""This class provides access to all Filters available in Pyrogram.
|
||||||
Filters are intended to be used with the :obj:`MessageHandler <pyrogram.MessageHandler>`."""
|
Filters are intended to be used with the :obj:`MessageHandler <pyrogram.MessageHandler>`."""
|
||||||
|
|
||||||
|
incoming = build("Incoming", lambda _, m: not m.outgoing)
|
||||||
|
"""Filter incoming messages."""
|
||||||
|
|
||||||
|
outgoing = build("Outgoing", lambda _, m: m.outgoing)
|
||||||
|
"""Filter outgoing messages."""
|
||||||
|
|
||||||
text = build("Text", lambda _, m: bool(m.text and not m.text.startswith("/")))
|
text = build("Text", lambda _, m: bool(m.text and not m.text.startswith("/")))
|
||||||
"""Filter text messages."""
|
"""Filter text messages."""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user