Document

class pyrogram.raw.types.Document

Document

Constructor of Document.

Details:
  • Layer: 227

  • 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
├── id → long
├── access_hash → long
├── file_reference → bytes
├── date → int
├── mime_type → string
├── size → long
├── thumbs → Vector < PhotoSize > (optional)
│ ├── PhotoSizeEmpty
│ │ └── type → string
│ ├── PhotoSize
│ │ ├── type → string
│ │ ├── w → int
│ │ ├── h → int
│ │ └── size → int
│ ├── PhotoCachedSize
│ │ ├── type → string
│ │ ├── w → int
│ │ ├── h → int
│ │ └── bytes → bytes
│ ├── PhotoStrippedSize
│ │ ├── type → string
│ │ └── bytes → bytes
│ ├── PhotoSizeProgressive
│ │ ├── type → string
│ │ ├── w → int
│ │ ├── h → int
│ │ └── sizes → Vector < int >
│ └── PhotoPathSize
│ ├── type → string
│ └── bytes → bytes
├── video_thumbs → Vector < VideoSize > (optional)
│ ├── VideoSize
│ │ ├── type → string
│ │ ├── w → int
│ │ ├── h → int
│ │ ├── size → int
│ │ └── video_start_ts → double (optional)
│ ├── VideoSizeEmojiMarkup
│ │ ├── emoji_id → long
│ │ └── background_colors → Vector < int >
│ ├── stickerset → InputStickerSet
│ │ ├── InputStickerSetEmpty
│ │ ├── InputStickerSetID
│ │ │ ├── id → long
│ │ │ └── access_hash → long
│ │ ├── InputStickerSetShortName
│ │ │ └── short_name → string
│ │ ├── InputStickerSetDice
│ │ │ └── emoticon → string
│ │ ├── InputStickerSetPremiumGifts
│ │ └── InputStickerSetTonGifts
│ ├── sticker_id → long
│ └── background_colors → Vector < int >
├── dc_id → int
└── attributes → Vector < DocumentAttribute >
│ ├── w → int
│ └── h → int
│ ├── mask → true (optional)
│ ├── alt → string
│ ├── stickerset → InputStickerSet
│ │ ├── InputStickerSetEmpty
│ │ ├── InputStickerSetID
│ │ │ ├── id → long
│ │ │ └── access_hash → long
│ │ ├── InputStickerSetShortName
│ │ │ └── short_name → string
│ │ ├── InputStickerSetDice
│ │ │ └── emoticon → string
│ │ ├── InputStickerSetPremiumGifts
│ │ └── InputStickerSetTonGifts
│ └── mask_coords → MaskCoords (optional)
│ └── MaskCoords
│ ├── n → int
│ ├── x → double
│ ├── y → double
│ └── zoom → double
│ ├── round_message → true (optional)
│ ├── supports_streaming → true (optional)
│ ├── nosound → true (optional)
│ ├── duration → double
│ ├── w → int
│ ├── h → int
│ ├── preload_prefix_size → int (optional)
│ ├── video_start_ts → double (optional)
│ └── video_codec → string (optional)
│ ├── voice → true (optional)
│ ├── duration → int
│ ├── title → string (optional)
│ ├── performer → string (optional)
│ └── waveform → bytes (optional)
│ └── file_name → string
├── free → true (optional)
├── text_color → true (optional)
├── alt → string
└── stickerset → InputStickerSet
│ ├── id → long
│ └── access_hash → long
│ └── short_name → string
│ └── emoticon → string

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
            )
        ],
)