mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 13:29:47 +00:00
Support custom-callback filter for all events
This commit is contained in:
@@ -31,8 +31,9 @@ class InlineQuery(EventBuilder):
|
||||
against the message, a callable function that returns ``True``
|
||||
if a message is acceptable, or a compiled regex pattern.
|
||||
"""
|
||||
def __init__(self, users=None, *, blacklist_users=False, pattern=None):
|
||||
super().__init__(chats=users, blacklist_chats=blacklist_users)
|
||||
def __init__(
|
||||
self, users=None, *, blacklist_users=False, func=None, pattern=None):
|
||||
super().__init__(users, blacklist_chats=blacklist_users, func=func)
|
||||
|
||||
if isinstance(pattern, str):
|
||||
self.pattern = re.compile(pattern).match
|
||||
|
Reference in New Issue
Block a user