get_chat_photos()

Client.get_chat_photos()

Get a chat or a user profile photos sequentially.

Usable by Users Bots
Parameters:
  • chat_id (``int`` | ``str``) – Unique identifier (int) or username (str) of the target chat. For your personal cloud (Saved Messages) you can simply use “me” or “self”. For a contact that exists in your Telegram address book you can use his phone number (str).

  • limit (``int``, *optional*) – Limits the number of profile photos to be retrieved. By default, no limit is applied and all profile photos are returned.

Returns:

``Generator`` (A generator yielding Photo | Animation objects.)

Example

async for photo in app.get_chat_photos("me"):
    print(photo)