LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!
https://docs.telethon.dev
MIT License
9.77k stars 1.39k forks source link

Agressive=True not working on client.get_participants #3712

Closed Jayceeit closed 2 years ago

Jayceeit commented 2 years ago

We are unable to use the Agressive = True setting on client.get_participants since last week. When using it, we get a number of floodwait errors. We don't get these floodwait errors when using the method client(getParticipantsRequest

#our participants request where target_group is a group ID
original_participants = client.get_participants(target_group, aggressive=True)

#this one works if I comment out the afforementioned
participants = client(GetParticipantsRequest(
        target_group, ChannelParticipantsAdmins(), offset, limit,
        hash=0
    ))

This only started recently, this code was working perfectly until then. We made no changes to our code in that time. We are thinking it has to do with an update in the past week.

Traceback

Traceback (most recent call last):
  File "main.py", line 123, in <module>
    original_participants = client.get_participants(target_group, aggressive=True)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/sync.py", line 39, in syncified
    return loop.run_until_complete(coro)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/client/chats.py", line 507, in get_participants
    return await self.iter_participants(*args, **kwargs).collect()
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/requestiter.py", line 113, in collect
    async for message in self:
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/requestiter.py", line 74, in __anext__
    if await self._load_next_chunk():
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/client/chats.py", line 222, in _load_next_chunk
    results = await self.client(self.requests)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/client/users.py", line 30, in __call__
    return await self._call(self._sender, request, ordered=ordered)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/telethon/client/users.py", line 80, in _call
    raise MultiError(exceptions, results, requests)
telethon.errors.common.MultiError: ([FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), None, FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), None, None, FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)')], [None, None, <telethon.tl.types.channels.ChannelParticipants object at 0x7fb1838508b0>, None, <telethon.tl.types.channels.ChannelParticipants object at 0x7fb18342b8b0>, <telethon.tl.types.channels.ChannelParticipants object at 0x7fb1834374f0>, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None], [<telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183933d30>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183933df0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183933eb0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183933f70>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937070>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937130>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb1839371f0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb1839372b0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937370>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937430>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb1839374f0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb1839375b0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937670>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937730>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb1839377f0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb1839378b0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937970>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937a30>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937af0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937bb0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937c70>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937d30>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937df0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937eb0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183937f70>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x7fb183939070>])
Thoufak commented 2 years ago

https://github.com/LonamiWebs/Telethon/issues/3709#issuecomment-1032615229

Lonami commented 2 years ago

Aggressive has been removed. Please use the issue template.

blindone0 commented 2 years ago

helped a lot, thanks

EllissonSB commented 1 year ago

offset is broken