telegram.ChatPhoto

class telegram.ChatPhoto(small_file_id, big_file_id, bot=None, **kwargs)

Bases: telegram.base.TelegramObject

This object represents a chat photo.

small_file_id

File identifier of small (160x160) chat photo.

Type:str
big_file_id

File identifier of big (640x640) chat photo.

Type:str
Parameters:
  • small_file_id (str) – File identifier of small (160x160) 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_id (str) – File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
  • bot (telegram.Bot, optional) – The Bot to use for instance methods
  • **kwargs (dict) – Arbitrary keyword arguments.
get_big_file(timeout=None, **kwargs)

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

Parameters:
  • timeout (int | float, optional) – If this value is specified, use it as the read timeout from the server (instead of the one specified during creation of the connection pool).
  • **kwargs (dict) – Arbitrary keyword arguments.
Returns:

telegram.File

Raises:

telegram.TelegramError

get_small_file(timeout=None, **kwargs)

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

Parameters:
  • timeout (int | float, optional) – If this value is specified, use it as the read timeout from the server (instead of the one specified during creation of the connection pool).
  • **kwargs (dict) – Arbitrary keyword arguments.
Returns:

telegram.File

Raises:

telegram.TelegramError