From 4d3ba7004e248e9ec83c6a7af5511d3165dca94b Mon Sep 17 00:00:00 2001 From: Netkas Date: Mon, 10 Apr 2023 17:47:33 -0400 Subject: [PATCH] Renamed `thumb` field in `TgBotLib\Objects\Telegram > Animation` to `thumbnail` https://git.n64.cc/nosial/libs/tgbot/-/issues/2 --- CHANGELOG.md | 1 + src/TgBotLib/Objects/Telegram/Animation.php | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 934f3fc..f19509b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ This update accompanies the release of the [Telegram Bot API 6.6](https://core.t ### Changed * Removed unused `__destruct()` method from `\TgBotLib\Bot` * Added proper construction for `PollOption[]` objects in `TgBotLib\Objects\Telegram > Poll` + * Renamed `thumb` field in `TgBotLib\Objects\Telegram > Animation` to `thumbnail` ## [6.5.2] - 2023-02-26 diff --git a/src/TgBotLib/Objects/Telegram/Animation.php b/src/TgBotLib/Objects/Telegram/Animation.php index 693f5fb..1792724 100644 --- a/src/TgBotLib/Objects/Telegram/Animation.php +++ b/src/TgBotLib/Objects/Telegram/Animation.php @@ -36,7 +36,7 @@ /** * @var PhotoSize|null */ - private $thumb; + private $thumbnail; /** * @var string|null @@ -105,13 +105,13 @@ } /** - * Optional. Animation thumbnail as defined by sender + * Optional. Animation thumbnailnail as defined by sender * * @return PhotoSize|null */ - public function getThumb(): ?PhotoSize + public function getThumbnail(): ?PhotoSize { - return $this->thumb; + return $this->thumbnail; } /** @@ -159,7 +159,7 @@ 'width' => $this->width ?? null, 'height' => $this->height ?? null, 'duration' => $this->duration ?? null, - '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 @@ -181,7 +181,7 @@ $object->width = $data['width'] ?? null; $object->height = $data['height'] ?? null; $object->duration = $data['duration'] ?? null; - $object->thumb = ($data['thumb'] ?? null) ? PhotoSize::fromArray($data['thumb']) : null; + $object->thumbnail = ($data['thumbnail'] ?? null) ? 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;