async def main():
for user in users:
print(f'Try send to {user}')
entity = await client.get_entity(user)
await client.send_message(entity=entity, message='Hello to myself!')
print(f'Send complete to {user}')
Получаю ошибку:
Traceback (most recent call last):
File "C:\Users\User\PycharmProjects\getterchats_users\sender.py", line 32, in <module>
client.loop.run_until_complete(main())
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
return future.result()
File "C:\Users\User\PycharmProjects\getterchats_users\sender.py", line 25, in main
await client.send_message(entity=entity, message='Hello to myself!')
File "C:\Users\UserPycharmProjects\getterchats_users\venv\lib\site-packages\telethon\client\messages.py", line 872, in send_message
result = await self(request)
File "C:\Users\User\PycharmProjects\getterchats_users\venv\lib\site-packages\telethon\client\users.py", line 30, in __call__
return await self._call(self._sender, request, ordered=ordered)
File "C:\Users\User\PycharmProjects\getterchats_users\venv\lib\site-packages\telethon\client\users.py", line 84, in _call
result = await future
telethon.errors.rpcerrorlist.PeerFloodError: Too many requests (caused by SendMessageRequest)
Process finished with exit code 1