try: send_file(...) except ValueError: print(event.chat.min)
event.chat is None
and here is my code in a event handler function: await client.send_file(event.chat_id, 'tts.mp3', voice_note=True)
error : ` Traceback (most recent call last): File "/home/penguin/.local/lib/python3.11/site-packages/telethon/client/updates.py", line 570, in _dispatch_update await callback(event) File "/home/penguin/projects/self/self.py", line 725, in spam await client.send_message(event.chat_id, text) File "/home/penguin/.local/lib/python3.11/site-packages/telethon/client/messages.py", line 838, in send_message entity = await self.get_input_entity(entity) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/penguin/.local/lib/python3.11/site-packages/telethon/client/users.py", line 467, in get_input_entity raise ValueError( ValueError: Could not find the input entity for PeerUser(user_id=2052354021) (PeerUser). Please read https://docs.telethon.dev/en/stable/concepts/entities.html to find out more details. `
Обсуждают сегодня