From e22f7896f81f4a4d109cfd8c2b3d48592f76d38e Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 25 Apr 2018 17:44:09 +0200 Subject: [PATCH] Add incoming and outgoing filters --- pyrogram/client/filters/filters.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index a1a52230..a73147c7 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -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 `.""" + 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."""