danog\MadelineProto\EventHandler\Media\Gif
Author: Daniil Gentili daniil@daniil.it
Represents a GIF (or an MPEG4 file without sound).
Properties
$hasStickers:boolIf true; the current media has attached mask stickers.$duration:floatVideo duration in seconds$supportsStreaming:boolWhether the video supports streaming$width:intVideo width$height:intVideo height$size:intMedia filesize$fileName:stringMedia file name$fileExt:stringMedia file extension$creationDate:intMedia creation date$mimeType:stringMedia MIME type$ttl:?intTime-to-live of media$thumbs:list<array>Thumbnails$videoThumbs:list<array>Video thumbnails$spoiler:boolWhether the media should be hidden behind a spoiler$botApiFileId:stringFile ID in bot API format (always present even for users)$botApiFileUniqueId:stringUnique file ID in bot API format (always present even for users)$encrypted:boolWhether this media originates from a secret chat.$thumb:?danog\MadelineProto\TL\Types\BytesContent of thumbnail file (JPEGfile, quality 55, set in a square 90x90) only for secret chats.$thumbHeight:?intThumbnail height only for secret chats.$thumbWidth:?intThumbnail width only for secret chats.$protected:boolWhether this media is protected
Method list:
save(): boolunsave(): boolgetDownloadLink((string|null) $scriptUrl = NULL): stringgetStream((callable(float, float, float): voi)|null) $cb = NULL, int $offset = 0, int $end = -1, ?\Amp\Cancellation $cancellation = NULL): \Amp\ByteStream\ReadableStreamdownloadToDir(string $dir = NULL, (callable(float, float, float): voi)|null) $cb = NULL, ?\Amp\Cancellation $cancellation = NULL): stringdownloadToFile(string $file, (callable(float, float, float): voi)|null) $cb = NULL, ?\Amp\Cancellation $cancellation = NULL): stringgetDownloadInfo(): array{ext: string, name: string, mime: string, size: int, InputFileLocation: array, key_fingerprint?: string, key?: string, iv?: string}
Methods:
save(): bool
Add GIF to saved gifs list.
unsave(): bool
Remove GIF from saved gifs list.
getDownloadLink((string|null) $scriptUrl = NULL): string
Gets a download link for any file up to 4GB.
Parameters:
$scriptUrl:(string|null)Optional path to custom download script (not needed when running via web)
getStream((callable(float, float, float): voi)|null) $cb = NULL, int $offset = 0, int $end = -1, ?\Amp\Cancellation $cancellation = NULL): \Amp\ByteStream\ReadableStream
Get a readable amp stream with the file contents.
Parameters:
$cb:(callable(float, float, float): voi)|null)Progress callback$offset:int$end:int$cancellation:?\Amp\Cancellation
See also:
\Amp\Cancellation\Amp\ByteStream\ReadableStream
downloadToDir(string $dir = NULL, (callable(float, float, float): voi)|null) $cb = NULL, ?\Amp\Cancellation $cancellation = NULL): string
Download the media to working directory or passed path.
Parameters:
$dir:stringDirectory where to download the file$cb:(callable(float, float, float): voi)|null)Progress callback$cancellation:?\Amp\Cancellation
See also:
\Amp\Cancellation
downloadToFile(string $file, (callable(float, float, float): voi)|null) $cb = NULL, ?\Amp\Cancellation $cancellation = NULL): string
Download the media to file.
Parameters:
$file:stringDownloaded file path$cb:(callable(float, float, float): voi)|null)Progress callback$cancellation:?\Amp\Cancellation
See also:
\Amp\Cancellation
getDownloadInfo(): array{ext: string, name: string, mime: string, size: int, InputFileLocation: array, key_fingerprint?: string, key?: string, iv?: string}
Generated by danog/phpdoc