Skip to main content

Animation

This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).

📝 Schema

FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
widthIntegerVideo width as defined by the sender
heightIntegerVideo height as defined by the sender
durationIntegerDuration of the video in seconds as defined by the sender
thumbnailPhotoSizeOptional. Animation thumbnail as defined by the sender
file_nameStringOptional. Original animation filename as defined by the sender
mime_typeStringOptional. MIME type of the file as defined by the sender
file_sizeIntegerOptional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

⚙️ Get methods

getFileId()

Retrieves the identifier for this animation file, which can be used to download or reuse the file.

$animationFileId = $animationObject->getFileId();

getFileUniqueId()

Retrieves the unique identifier for this animation file, which remains constant over time and across different bots.

$animationFileUniqueId = $animationObject->getFileUniqueId();

getWidth()

Retrieves the animation width as defined by the sender.

$animationWidth = $animationObject->getWidth();

getHeight()

Retrieves the animation height as defined by the sender.

$animationHeight = $animationObject->getHeight();

getDuration()

Retrieves the duration of the animation in seconds as defined by the sender.

$animationDuration = $animationObject->getDuration();

getThumbnail()

Retrieves the thumbnail of the animation as a PhotoSize object.

$animationThumbnail = $animationObject->getThumbnail();

getFileName()

Retrieves the original animation filename as defined by the sender.

$animationFileName = $animationObject->getFileName();

getMimeType()

Retrieves the MIME type of the animation file as defined by the sender.

$animationMimeType = $animationObject->getMimeType();

getFileSize()

Retrieves the file size of the animation in bytes, if available.

$animationFileSize = $animationObject->getFileSize();

➕ More

tip

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