InputMediaDocument
Represents a general file to be sent.
π Schemaβ
Field | Type | Description |
---|---|---|
type | string | Type of the result, must be document |
media | string | File to send. Pass a file_id to send a file that exists on the Bale servers (recommended), pass an HTTP URL for Bale to get a file from the Internet, or pass βattach://<file_attach_name> β to upload a new one using multipart/form-data under <file_attach_name> name |
thumbnail | InputFile , string | Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data . Thumbnails can't be reused and can be only uploaded as a new file, so you can pass βattach://<file_attach_name> β if the thumbnail was uploaded using multipart/form-data under <file_attach_name> . |
caption | string | Optional. Caption of the document to be sent, 0-1024 characters after entities parsing |
βοΈ Get methodsβ
getType()β
Retrieves the type of the media, which should always return "document".
$type = $inputMediaDocumentObject->getType();
getMedia()β
Retrieves the media file (either file_id, HTTP URL, or attach reference) to be sent.
$media = $inputMediaDocumentObject->getMedia();
getThumbnail()β
Retrieves the thumbnail of the document file. This will either be a file_id, HTTP URL, or attach reference if uploaded using multipart/form-data
.
$thumbnail = $inputMediaDocumentObject->getThumbnail();
getCaption()β
Retrieves the caption of the document to be sent. It returns a string value (0-1024 characters).
$caption = $inputMediaDocumentObject->getCaption();
β Moreβ
tip
For further information, refer to the official Bale documentation for more details.