Iterate through a chat or a user profile photos sequentially.
This convenience method does the same as repeatedly calling
get_profile_photos()in a loop, thus saving you from the hassle of setting up boilerplate code. It is useful for getting all the profile photos with a single call.
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).
int, optional) – Limits the number of profile photos to be retrieved. By default, no limit is applied and all profile photos are returned.
int, optional) – Sequential number of the first profile photo to be returned.
Generator– A generator yielding
for photo in app.iter_profile_photos("haskell"): print(photo.file_id)