search_contacts()

Client.search_contacts()

Returns users or channels found by name substring and auxiliary data.

Usable by Users Bots
Parameters:
  • query (str) – Target substring.

  • limit (int, optional) – Maximum number of users to be returned.

Returns:

FoundContacts – On success, a list of chats is returned.

Example

await app.search_contacts("pyrogram")