mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 03:13:45 +03:00
Add some missing filters
This commit is contained in:
parent
96b4059ae8
commit
4b477e5b27
|
@ -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`.
|
||||
|
|
Loading…
Reference in New Issue
Block a user