telegram.Document

class telegram.Document(file_id, thumb=None, file_name=None, mime_type=None, file_size=None, **kwargs)

Bases: telegram.base.TelegramObject

This object represents a general file (as opposed to photos, voice messages and audio files).

file_id

str – Unique file identifier.

thumb

telegram.PhotoSize – Optional. Document thumbnail.

file_name

str – Original filename.

mime_type

str – Optional. MIME type of the file.

file_size

int – Optional. File size.

Parameters:
  • file_id (str) – Unique file identifier
  • thumb (telegram.PhotoSize, optional) – Document thumbnail as defined by sender.
  • file_name (str, optional) – Original filename as defined by sender.
  • mime_type (str, optional) – MIME type of the file as defined by sender.
  • file_size (int, optional) – File size.
  • **kwargs (dict) – Arbitrary keyword arguments.