Renamed thumb field in TgBotLib\Objects\Telegram > Audio to thumbnail

https://git.n64.cc/nosial/libs/tgbot/-/issues/2
This commit is contained in:
Netkas 2023-04-10 19:03:05 -04:00
parent 4d3ba7004e
commit af8fabceaa
2 changed files with 6 additions and 5 deletions

View file

@ -34,6 +34,7 @@ This update accompanies the release of the [Telegram Bot API 6.6](https://core.t
* 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`
* Renamed `thumb` field in `TgBotLib\Objects\Telegram > Audio` to `thumbnail`
## [6.5.2] - 2023-02-26

View file

@ -51,7 +51,7 @@
/**
* @var PhotoSize|null
*/
private $thumb;
private $thumbnail;
/**
* Identifier for this file, which can be used to download or reuse the file
@ -141,9 +141,9 @@
*
* @return PhotoSize|null
*/
public function getThumb(): ?PhotoSize
public function getThumbnail(): ?PhotoSize
{
return $this->thumb;
return $this->thumbnail;
}
public function toArray(): array
@ -157,7 +157,7 @@
'file_name' => $this->file_name ?? null,
'mime_type' => $this->mime_type ?? null,
'file_size' => $this->file_size ?? null,
'thumb' => ($this->thumb instanceof ObjectTypeInterface) ? $this->thumb->toArray() : null,
'thumbnail' => ($this->thumbnail instanceof ObjectTypeInterface) ? $this->thumbnail->toArray() : null,
];
}
@ -179,7 +179,7 @@
$object->file_name = $data['file_name'] ?? null;
$object->mime_type = $data['mime_type'] ?? null;
$object->file_size = $data['file_size'] ?? null;
$object->thumb = ($data['thumb'] ?? null) ? PhotoSize::fromArray($data['thumb']) : null;
$object->thumbnail = ($data['thumbnail'] ?? null) ? PhotoSize::fromArray($data['thumbnail']) : null;
return $object;
}