mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-19 20:42:18 +03:00
Updated Retrieving an entity (markdown)
parent
52f1b6e722
commit
d0e76f862b
|
@ -32,11 +32,7 @@ If the user you want to talk to is a contact, you can use [`GetContactsRequest`]
|
||||||
from telethon.tl.functions.contacts import GetContactsRequest
|
from telethon.tl.functions.contacts import GetContactsRequest
|
||||||
from telethon.tl.types.contacts import Contacts
|
from telethon.tl.types.contacts import Contacts
|
||||||
|
|
||||||
# `.sign_in()´ returns your User, otherwise use:
|
contacts = client(GetContactsRequest(0))
|
||||||
self_user = client.get_me()
|
|
||||||
|
|
||||||
# Even an empty hash for GetContactsRequest seems to work
|
|
||||||
contacts = client(GetContactsRequest(self_user.access_hash))
|
|
||||||
if isinstance(contacts, Contacts):
|
if isinstance(contacts, Contacts):
|
||||||
users = contacts.users
|
users = contacts.users
|
||||||
contacts = contacts.contacts
|
contacts = contacts.contacts
|
||||||
|
|
Loading…
Reference in New Issue
Block a user