Document

class pyrogram.raw.types.Document

Document

Constructor of Document.

Details:
  • Layer: 223

  • ID: 8FD4C4D8

Parameters:
  • id (int 64-bit) – Document ID

  • access_hash (int 64-bit) – Check sum, dependent on document ID

  • file_reference (bytes) – File reference

  • date (int 32-bit) – Creation date

  • mime_type (str) – MIME type

  • size (int 64-bit) – Size

  • dc_id (int 32-bit) – DC ID

  • attributes (List of DocumentAttribute) – Attributes

  • thumbs (List of PhotoSize, optional) – Thumbnails

  • video_thumbs (List of VideoSize, optional) – Video thumbnails

Functions:

This object can be returned by 4 functions.

account.UploadTheme

Upload theme

account.UploadRingtone

Upload notification sound, use account.saveRingtone to convert it and add it to the list of saved notification sounds.

messages.GetDocumentByHash

Get a document by its SHA256 hash, mainly used for gifs

messages.GetCustomEmojiDocuments

Fetch custom emoji stickers ».

TL Schema

document#8fd4c4d8
flags:#
id:long
access_hash:long
file_reference:bytes
date:int
mime_type:string
size:long
thumbs:flags.0?Vector<PhotoSize>
video_thumbs:flags.1?Vector<VideoSize>
dc_id:int
attributes:Vector<DocumentAttribute>

= Document

Parameter Tree

Document
├── idlong
├── access_hashlong
├── file_referencebytes
├── dateint
├── mime_typestring
├── sizelong
├── thumbsVector < PhotoSize > (optional)
│ ├── PhotoSizeEmpty
│ │ └── typestring
│ ├── PhotoSize
│ │ ├── typestring
│ │ ├── wint
│ │ ├── hint
│ │ └── sizeint
│ ├── PhotoCachedSize
│ │ ├── typestring
│ │ ├── wint
│ │ ├── hint
│ │ └── bytesbytes
│ ├── PhotoStrippedSize
│ │ ├── typestring
│ │ └── bytesbytes
│ ├── PhotoSizeProgressive
│ │ ├── typestring
│ │ ├── wint
│ │ ├── hint
│ │ └── sizesVector < int >
│ └── PhotoPathSize
│ ├── typestring
│ └── bytesbytes
├── video_thumbsVector < VideoSize > (optional)
│ ├── VideoSize
│ │ ├── typestring
│ │ ├── wint
│ │ ├── hint
│ │ ├── sizeint
│ │ └── video_start_tsdouble (optional)
│ ├── VideoSizeEmojiMarkup
│ │ ├── emoji_idlong
│ │ └── background_colorsVector < int >
│ ├── stickersetInputStickerSet
│ │ ├── InputStickerSetEmpty
│ │ ├── InputStickerSetID
│ │ │ ├── idlong
│ │ │ └── access_hashlong
│ │ ├── InputStickerSetShortName
│ │ │ └── short_namestring
│ │ ├── InputStickerSetDice
│ │ │ └── emoticonstring
│ │ ├── InputStickerSetPremiumGifts
│ │ └── InputStickerSetTonGifts
│ ├── sticker_idlong
│ └── background_colorsVector < int >
├── dc_idint
└── attributesVector < DocumentAttribute >
│ ├── wint
│ └── hint
│ ├── masktrue (optional)
│ ├── altstring
│ ├── stickersetInputStickerSet
│ │ ├── InputStickerSetEmpty
│ │ ├── InputStickerSetID
│ │ │ ├── idlong
│ │ │ └── access_hashlong
│ │ ├── InputStickerSetShortName
│ │ │ └── short_namestring
│ │ ├── InputStickerSetDice
│ │ │ └── emoticonstring
│ │ ├── InputStickerSetPremiumGifts
│ │ └── InputStickerSetTonGifts
│ └── mask_coordsMaskCoords (optional)
│ └── MaskCoords
│ ├── nint
│ ├── xdouble
│ ├── ydouble
│ └── zoomdouble
│ ├── round_messagetrue (optional)
│ ├── supports_streamingtrue (optional)
│ ├── nosoundtrue (optional)
│ ├── durationdouble
│ ├── wint
│ ├── hint
│ ├── preload_prefix_sizeint (optional)
│ ├── video_start_tsdouble (optional)
│ └── video_codecstring (optional)
│ ├── voicetrue (optional)
│ ├── durationint
│ ├── titlestring (optional)
│ ├── performerstring (optional)
│ └── waveformbytes (optional)
│ └── file_namestring
├── freetrue (optional)
├── text_colortrue (optional)
├── altstring
└── stickersetInputStickerSet
│ ├── idlong
│ └── access_hashlong
│ └── short_namestring
│ └── emoticonstring

Example

Document(
    id=0,
    access_hash=0,
    file_reference=b"data",
    date=0,
    mime_type="text",
    size=0,
    dc_id=0,
    attributes=[
            DocumentAttributeImageSize(
                w=0,
                h=0
            )
        ],
)