From c7ac616198c57d5262308a29b4946b78d4da0fa5 Mon Sep 17 00:00:00 2001 From: s3mple <42579165+s3mple@users.noreply.github.com> Date: Tue, 21 Aug 2018 17:46:54 +0300 Subject: [PATCH] Update chats.py Added the ability to aggressive search with custom set of symbols --- telethon/client/chats.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/telethon/client/chats.py b/telethon/client/chats.py index 3680f7c2..eabfdfe8 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -25,6 +25,9 @@ class ChatMethods(UserMethods): search (`str`, optional): Look for participants with this string in name/username. + + If ``aggressive is True``, the symbols from this string will + be used filter (:tl:`ChannelParticipantsFilter`, optional): The filter to be used, if you want e.g. only admins @@ -86,11 +89,11 @@ class ChatMethods(UserMethods): if aggressive and not filter: requests = [functions.channels.GetParticipantsRequest( channel=entity, - filter=types.ChannelParticipantsSearch(search + chr(x)), + filter=types.ChannelParticipantsSearch(x), offset=0, limit=200, hash=0 - ) for x in range(ord('a'), ord('z') + 1)] + ) for x in search or range(ord('a'), ord('z') + 1)] else: requests = [functions.channels.GetParticipantsRequest( channel=entity,