From da8108c196eca1c7e4e5b03b9bb3fbc8df5b2aae Mon Sep 17 00:00:00 2001 From: Netkas Date: Mon, 10 Apr 2023 19:16:32 -0400 Subject: [PATCH] Renamed `thumb` field in `TgBotLib\Objects\Telegram > Video` to `thumbnail` https://git.n64.cc/nosial/libs/tgbot/-/issues/2 --- CHANGELOG.md | 1 + src/TgBotLib/Objects/Telegram/Video.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30d2782..4033728 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ This update accompanies the release of the [Telegram Bot API 6.6](https://core.t * Renamed `thumb` field in `TgBotLib\Objects\Telegram > Audio` to `thumbnail` * Renamed `thumb` field in `TgBotLib\Objects\Telegram > Document` to `thumbnail` * Renamed `thumb` field in `TgBotLib\Objects\Telegram > Sticker` to `thumbnail` + * Renamed `thumb` field in `TgBotLib\Objects\Telegram > Video` to `thumbnail` ## Fixed * Fixed `TgBotLib\Objects\Telegram > Sticker > toArray()` to properly return the `premium_animation` field diff --git a/src/TgBotLib/Objects/Telegram/Video.php b/src/TgBotLib/Objects/Telegram/Video.php index 1edc854..233fc00 100644 --- a/src/TgBotLib/Objects/Telegram/Video.php +++ b/src/TgBotLib/Objects/Telegram/Video.php @@ -34,7 +34,7 @@ /** * @var PhotoSize|null */ - private $thumb; + private $thumbnail; /** * @var string|null @@ -107,9 +107,9 @@ * * @return PhotoSize|null */ - public function getThumb(): ?PhotoSize + public function getThumbnail(): ?PhotoSize { - return $this->thumb; + return $this->thumbnail; } /** @@ -157,7 +157,7 @@ 'width' => $this->width, 'height' => $this->height, 'duration' => $this->duration, - 'thumb' => ($this->thumb instanceof ObjectTypeInterface) ? $this->thumb->toArray() : null, + 'thumbnail' => ($this->thumbnail instanceof ObjectTypeInterface) ? $this->thumbnail->toArray() : null, 'file_name' => $this->file_name ?? null, 'mime_type' => $this->mime_type ?? null, 'file_size' => $this->file_size ?? null, @@ -179,7 +179,7 @@ $object->width = $data['width']; $object->height = $data['height']; $object->duration = $data['duration']; - $object->thumb = (isset($data['thumb'])) ? PhotoSize::fromArray($data['thumb']) : null; + $object->thumbnail = (isset($data['thumbnail'])) ? PhotoSize::fromArray($data['thumbnail']) : null; $object->file_name = $data['file_name'] ?? null; $object->mime_type = $data['mime_type'] ?? null; $object->file_size = $data['file_size'] ?? null;