skip to Main Content

I wonder how I can find the id of a certain user I started a regular or secret chat with.

Example:

dialogs=client.get_dialogs()
for dialog in dialogs:
    print(dialog.peerUser_id)

What can substitute the peerUser_id?
Note: I use Telethon Library

2

Answers


  1. Chosen as BEST ANSWER

    SOLVED.

    To find out the user id from a private conversation (which is a Dialog in the example) you can use :

    dialog.message.peer_id.user_id
    

  2. You can’t. Secret chats are per device and as such, you can’t get any information about It from another device. the only device that sees it is the one that started it so if you didn’t start it yourself you won’t be able to see it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search