diff --git a/Retrieving-an-entity.md b/Retrieving-an-entity.md index c936bf8..2119a21 100644 --- a/Retrieving-an-entity.md +++ b/Retrieving-an-entity.md @@ -4,7 +4,7 @@ An "entity" is used to refer to either an [`User`](https://lonamiwebs.github.io/ ```python from telethon.tl.functions.contacts import ResolveUsernameRequest -result = client.invoke(ResolveUsernameRequest('username')) +result = client(ResolveUsernameRequest('username')) found_chats = result.chats found_users = result.users # result.peer may be a PeerUser, PeerChat or PeerChannel @@ -34,7 +34,9 @@ from telethon.tl.types.contacts import Contacts # `.sign_in()ยด returns your User, otherwise use: self_user = client.get_me() -contacts = client.invoke(GetContactsRequest(self_user.access_hash)) + +# Even an empty hash for GetContactsRequest seems to work +contacts = client(GetContactsRequest(self_user.access_hash)) if isinstance(contacts, Contacts): users = contacts.users contacts = contacts.contacts