MadelineProtoDocs/docs/API_docs/constructors/document.md
2019-03-08 14:35:09 +01:00

1.7 KiB

title description image
document Document https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png

Constructor: document

Back to constructors index

Document

Attributes:

Name Type Required Description
id long Yes ID
access_hash long Yes Access hash
file_reference bytes Yes File reference
date int Yes Date
mime_type string Yes Mime type
size int Yes Size
thumbs Array of PhotoSize Optional Thumbnails
dc_id int Yes DC ID
attributes Array of DocumentAttribute Yes Attributes

Type: Document

Example:

$document = ['_' => 'document', 'id' => long, 'access_hash' => long, 'file_reference' => 'bytes', 'date' => int, 'mime_type' => 'string', 'size' => int, 'thumbs' => [PhotoSize, PhotoSize], 'dc_id' => int, 'attributes' => [DocumentAttribute, DocumentAttribute]];

PWRTelegram json-encoded version:

{"_": "document", "id": long, "access_hash": long, "file_reference": {"_": "bytes", "bytes":"base64 encoded bytes"}, "date": int, "mime_type": "string", "size": int, "thumbs": [PhotoSize], "dc_id": int, "attributes": [DocumentAttribute]}

Or, if you're into Lua:

document={_='document', id=long, access_hash=long, file_reference='bytes', date=int, mime_type='string', size=int, thumbs={PhotoSize}, dc_id=int, attributes={DocumentAttribute}}