mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-07 13:34:59 +03:00
Update chats.py
Added the ability to aggressive search with custom set of symbols
This commit is contained in:
parent
fbc46bd388
commit
c7ac616198
|
@ -25,6 +25,9 @@ class ChatMethods(UserMethods):
|
||||||
|
|
||||||
search (`str`, optional):
|
search (`str`, optional):
|
||||||
Look for participants with this string in name/username.
|
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):
|
filter (:tl:`ChannelParticipantsFilter`, optional):
|
||||||
The filter to be used, if you want e.g. only admins
|
The filter to be used, if you want e.g. only admins
|
||||||
|
@ -86,11 +89,11 @@ class ChatMethods(UserMethods):
|
||||||
if aggressive and not filter:
|
if aggressive and not filter:
|
||||||
requests = [functions.channels.GetParticipantsRequest(
|
requests = [functions.channels.GetParticipantsRequest(
|
||||||
channel=entity,
|
channel=entity,
|
||||||
filter=types.ChannelParticipantsSearch(search + chr(x)),
|
filter=types.ChannelParticipantsSearch(x),
|
||||||
offset=0,
|
offset=0,
|
||||||
limit=200,
|
limit=200,
|
||||||
hash=0
|
hash=0
|
||||||
) for x in range(ord('a'), ord('z') + 1)]
|
) for x in search or range(ord('a'), ord('z') + 1)]
|
||||||
else:
|
else:
|
||||||
requests = [functions.channels.GetParticipantsRequest(
|
requests = [functions.channels.GetParticipantsRequest(
|
||||||
channel=entity,
|
channel=entity,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user