MM
Size: a a a
А
В
В
В
А
dialogs = await client.get_dialogs()
решает это - зря, да?).......
async def zapusk():
print("zapusk")
dialogs = await client.get_dialogs()
adminid = await client.get_entity(602592170)
await client.send_message(adminid, "Bot started!2")
client.start()
logging.info('загрузка завершена')
client.loop.run_until_complete(zapusk())
client.run_until_disconnected()
В
В
V
В
А
А
await client.send_message(admin_id, "Bot started!2
В
В
В
А
test.py[LINE:153]# INFO [2021-04-28 15:44:33,206] загрузка завершена
zapusk
Traceback (most recent call last):
File "C:\Users\Support\Documents\test.py", line 154, in <module>
client.loop.run_until_complete(zapusk())
File "C:\Users\Support\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "C:\Users\Support\Documents\test.py", line 150, in zapusk
await client.send_message(admin_id, "Bot started!2")
File "C:\Users\Support\AppData\Local\Programs\Python\Python39\lib\site-packages\telethon\client\messages.py", line 767, in send_message
entity = await self.get_input_entity(entity)
File "C:\Users\Support\AppData\Local\Programs\Python\Python39\lib\site-packages\telethon\client\users.py", line 461, in get_input_entity
raise ValueError(
ValueError: Could not find the input entity for <telethon.tl.types.PeerUser object at 0x00000225F46B2040>. Please read https://docs.telethon.dev/en/latest/concepts/entities.html to find out more details. Для продолжения нажмите любую клавишу . . .
В
print(602592170 in [d.entity.id for d in (await client.get_dialogs())])
В
Ж
.get_dialogs()
всё решил