Я не знаю, что не так, но я застрял при создании моей программы. У кого-нибудь есть идеи по этому поводу?
Это ошибка, которую я получаю:
*Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\Telegram Marketing\add members in channel\add members.py", line 50, in <module>
user_to_add = client.get_input_entity(user['username'])
File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\telethon\sync.py", line 39, in syncified
return loop.run_until_complete(coro)
File "c:\users\administrator\appdata\local\programs\python\python38\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\telethon\client\users.py", line 404, in get_input_entity
await self._get_entity_from_string(peer))
File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\telethon\client\users.py", line 516, in _get_entity_from_string
result = await self(
File "c:\users\administrator\appdata\local\programs\python\python38\lib\site-packages\telethon\client\users.py", line 47, in __call__
raise errors.FloodWaitError(request=r, capture=diff)
telethon.errors.rpcerrorlist.FloodWaitError: A wait of 71180 seconds is required (caused by ResolveUsernameRequest)
Unexpected Error *
Мой код:
channel = client(GetFullChannelRequest(channel_username))
mode = 1
for user in users:
try:
print ("Adding {}".format(user['id']))
if mode == 1:
if user['username'] == "":
continue
user_to_add = client.get_input_entity(user['username'])
else:
sys.exit("Invalid Mode Selected. Please Try Again.")
client(InviteToChannelRequest(channel,[user_to_add]))
print("Waiting 60 Seconds...")
time.sleep(60)
except PeerFloodError:
print("Getting Flood Error from telegram. Script is stopping now. Please try again after some time.")
time.sleep(900)
except UserPrivacyRestrictedError:
print("The user's privacy settings do not allow you to do this. Skipping.")
except:
traceback.print_exc()
print("Unexpected Error")
continue