Update chats.py

Added the ability to aggressive search with custom set of symbols
This commit is contained in:
s3mple 2018-08-21 17:28:46 +03:00 committed by GitHub
parent fbc46bd388
commit 5722b5a91e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,8 +11,9 @@ class ChatMethods(UserMethods):
@async_generator
async def iter_participants(
self, entity, limit=None, *, search='',
filter=None, aggressive=False, _total=None):
self, entity, limit=None, *, search='',
filter=None, aggressive=False, symbols=None,
_total=None):
"""
Iterator over the participants belonging to the specified chat.
@ -41,6 +42,9 @@ class ChatMethods(UserMethods):
This has no effect if a ``filter`` is given.
symbols (`list`, optional):
Set of symbols for aggressive search
_total (`list`, optional):
A single-item list to pass the total parameter by reference.
@ -90,7 +94,7 @@ class ChatMethods(UserMethods):
offset=0,
limit=200,
hash=0
) for x in range(ord('a'), ord('z') + 1)]
) for x in symbols or range(ord('a'), ord('z') + 1)]
else:
requests = [functions.channels.GetParticipantsRequest(
channel=entity,