Hide navigation sidebar
Hide table of contents sidebar
PTB has undergone significant changes in v20. Please read the documentation carefully and also check out the transition guide in the wiki.
Back to top
Toggle table of contents sidebar

# ChatPhoto

class telegram.ChatPhoto(small_file_id, small_file_unique_id, big_file_id, big_file_unique_id, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This object represents a chat photo.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `small_file_unique_id` and `big_file_unique_id` are equal.

  Parameters:

    - small_file_id (`str`) – File identifier of small (`160` x `160`) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.

    - small_file_unique_id (`str`) – Unique file identifier of small (`160` x `160`) chat photo, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

    - big_file_id (`str`) – File identifier of big (`640` x `640`) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.

    - big_file_unique_id (`str`) – Unique file identifier of big (`640` x `640`) chat photo, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  small_file_id

    File identifier of small (`160` x `160`) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.

    Type:

      `str`

  small_file_unique_id

    Unique file identifier of small (`160` x `160`) chat photo, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

    Type:

      `str`

  big_file_id

    File identifier of big (`640` x `640`) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.

    Type:

      `str`

  big_file_unique_id

    Unique file identifier of big (`640` x `640`) chat photo, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

    Type:

      `str`

  Use In

  `telegram.Bot.get_file()`

  Available In

  `telegram.Chat.photo`

  SIZE_BIG = 640

    `telegram.constants.ChatPhotoSize.BIG`

    New in version 20.0.

  SIZE_SMALL = 160

    `telegram.constants.ChatPhotoSize.SMALL`

    New in version 20.0.

  async get_big_file(*, read_timeout=None, write_timeout=None, connect_timeout=None, pool_timeout=None, api_kwargs=None)

    Convenience wrapper over `telegram.Bot.get_file()` for getting the big (`640` x `640`) chat photo

    For the documentation of the arguments, please see `telegram.Bot.get_file()`.

    Returns:

      `telegram.File`

    Raises:

      telegram.error.TelegramError –

  async get_small_file(*, read_timeout=None, write_timeout=None, connect_timeout=None, pool_timeout=None, api_kwargs=None)

    Convenience wrapper over `telegram.Bot.get_file()` for getting the small (`160` x `160`) chat photo

    For the documentation of the arguments, please see `telegram.Bot.get_file()`.

    Returns:

      `telegram.File`

    Raises:

      telegram.error.TelegramError –