2
0
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:
Dan 2018-04-25 17:44:09 +02:00
parent 3e4135c8e1
commit e22f7896f8

View File

@ -32,6 +32,12 @@ class Filters:
"""This class provides access to all Filters available in Pyrogram.
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("/")))
"""Filter text messages."""