diff --git a/telethon/_events/filters/messages.py b/telethon/_events/filters/messages.py index a6bacbd6..e1b1c3a3 100644 --- a/telethon/_events/filters/messages.py +++ b/telethon/_events/filters/messages.py @@ -2,6 +2,24 @@ import re from .base import Filter +class Incoming: + """ + The update must be something the client received from another user, + and not something the current user sent. + """ + def __call__(self, event): + return not event.out + + +class Outgoing: + """ + The update must be something the current user sent, + and not something received from another user. + """ + def __call__(self, event): + return event.out + + class Pattern: """ The update type must match the specified instances for the filter to return `True`.