Skip to main content

InputMediaPhoto

Represents a photo to be sent.

📝 Schema

FieldTypeDescription
typestringType of the result, must be photo
mediastringFile 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.
captionstringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing

⚙️ Get methods

getType()

Retrieves the type of the media, which should always return "photo".

$type = $inputMediaPhotoObject->getType();

getMedia()

Retrieves the media file (either file_id, HTTP URL, or attach reference) to be sent.

$media = $inputMediaPhotoObject->getMedia();

getCaption()

Retrieves the caption of the photo to be sent. It returns a string value (0-1024 characters).

$caption = $inputMediaPhotoObject->getCaption();

➕ More

tip

For further information, refer to the official Bale documentation for more details.