D
D
Denys Plakhtii2021-08-25 19:25:33
Python
Denys Plakhtii, 2021-08-25 19:25:33

An invalid Peer error when using Telethon. How to fix?

Hello. I use the Telethon library to interact with the Telegram API.

The code:

receiver = InputPeerUser(user['id'], user['access_hash'])
await client(SendMessageRequest(receiver, message))


Exception:
An invalid Peer was used. Make sure to pass the right peer type and that the value is valid (for instance, bots cannot start conversations) (caused by SendMessageRequest)

Did according to the documentation:
https://docs.telethon.dev/en/latest/concepts/full-...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question