Thumbnails */ public readonly array $thumbs; /** @var list Video thumbnails */ public readonly array $videoThumbs; /** Whether the media should be hidden behind a spoiler */ public readonly bool $spoiler; /** File ID in bot API format (always present even for users) */ public readonly string $botApiFileId; /** Unique file ID in bot API format (always present even for users) */ public readonly string $botApiFileUniqueId; /** @internal Media location */ public readonly array $location; /** @internal */ public function __construct( MTProto $API, array $rawMedia, /** Whether this media is protected */ public readonly bool $protected ) { parent::__construct($API); [ 'name' => $name, 'ext' => $this->fileExt, 'mime' => $this->mimeType, 'size' => $this->size, 'InputFileLocation' => $this->location ] = $API->getDownloadInfo($rawMedia); $this->fileName = "$name.".$this->fileExt; [ 'file_id' => $this->botApiFileId, 'file_unique_id' => $this->botApiFileUniqueId ] = $API->extractBotAPIFile($API->MTProtoToBotAPI($rawMedia)); $this->creationDate = ($rawMedia['document'] ?? $rawMedia['photo'])['date']; $this->ttl = $rawMedia['ttl_seconds'] ?? null; $this->spoiler = $rawMedia['spoiler'] ?? false; } public function jsonSerialize(): mixed { $v = \get_object_vars($this); unset($v['API'], $v['session'], $v['location']); $v['_'] = static::class; return $v; } }