redianmarku/telegram-dm-bot

Flood message

Opened this issue · 7 comments

smsbot.py get error flooding message

smsbot.py get error flooding message

yes this is true... how can we avoid this

I'm getting the same

I’m getting this error [+] Enter a Number : 38
[+] Fetching Members...
Traceback (most recent call last):
File "C:\Users\Shadow\Desktop\telegram-dm-bot-master\scraper.py", line 80, in
all_participants = client.get_participants(target_group, aggressive=True)
File "C:\Users\Shadow\Desktop\telegram-dm-bot-master\venv\lib\site-packages\telethon\sync.py", line 39, in syncified
return loop.run_until_complete(coro)
File "C:\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "C:\Users\Shadow\Desktop\telegram-dm-bot-master\venv\lib\site-packages\telethon\client\chats.py", line 507, in get_participants
return await self.iter_participants(*args, **kwargs).collect()
File "C:\Users\Shadow\Desktop\telegram-dm-bot-master\venv\lib\site-packages\telethon\requestiter.py", line 113, in collect
async for message in self:
File "C:\Users\Shadow\Desktop\telegram-dm-bot-master\venv\lib\site-packages\telethon\requestiter.py", line 74, in anext
if await self._load_next_chunk():
File "C:\Users\Shadow\Desktop\telegram-dm-bot-master\venv\lib\site-packages\telethon\client\chats.py", line 222, in _load_next_chunk
results = await self.client(self.requests)
File "C:\Users\Shadow\Desktop\telegram-dm-bot-master\venv\lib\site-packages\telethon\client\users.py", line 30, in call
return await self._call(self._sender, request, ordered=ordered)
File "C:\Users\Shadow\Desktop\telegram-dm-bot-master\venv\lib\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)'), None, None, 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)'), FloodWaitError('A wait of 30 seconds is required (caused by GetParticipantsRequest)')], [None, <telethon.tl.types.channels.ChannelParticipants object at 0x000002305E8E19F0>, <telethon.tl.types.channels.ChannelParticipants object at 0x000002305E8E1870>, None, None, <telethon.tl.types.channels.ChannelParticipants object at 0x000002305E997EB0>, None, None], [<telethon.tl.functions.channels.GetParticipantsRequest object at 0x000002305E9971C0>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000002305E997280>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000002305E997640>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000002305E997700>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000002305E997A00>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000002305E997C40>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000002305E998040>, <telethon.tl.functions.channels.GetParticipantsRequest object at 0x000002305E998280>])

XMVZ commented

getting the same you need to fix with a cooldown / waiting period

Yes, should build in some sleep and retry here, my python skills aren't that great unfortunately...

except PeerFloodError:
print(
re+"[!] Getting Flood Error from telegram. \n[!] Script is stopping now. \n[!] Please try again after some time.")
client.disconnect()
sys.exit()

Could also increase the sleep time to +- max 35 messages per day.