Added the field _needs_repainting_ to the [Sticker](https://core.telegram.org/bots/api#sticker) class which can be obtained via TgBotLib\Objects\Telegram > Sticker > needsRepainting()
https://git.n64.cc/nosial/libs/tgbot/-/issues/2
This commit is contained in:
parent
c17773e5d2
commit
65564ecb2a
2 changed files with 20 additions and 0 deletions
|
@ -20,6 +20,8 @@ This update accompanies the release of the [Telegram Bot API 6.6](https://core.t
|
|||
using the method `\TgBotLib\Bot > getMyShortDescription()` see [getMyShortDescription](https://core.telegram.org/bots/api#getmyshortdescription) for more information.
|
||||
* Added method `\TgBotLib\Bot > sendSticker()` to send a sticker to a chat. See [sendSticker](https://core.telegram.org/bots/api#sendsticker) for more information.
|
||||
* Added method `\TgBotLib\Bot > createNewStickerSet()` to create a new sticker set owned by a user. See [createNewStickerSet](https://core.telegram.org/bots/api#createnewstickerset) for more information.
|
||||
* Added the field _needs_repainting_ to the [Sticker](https://core.telegram.org/bots/api#sticker) class
|
||||
which can be obtained via `TgBotLib\Objects\Telegram > Sticker > needsRepainting()`
|
||||
|
||||
### Changed
|
||||
* Removed unused `__destruct()` method from `\TgBotLib\Bot`
|
||||
|
|
|
@ -73,6 +73,11 @@
|
|||
*/
|
||||
private $custom_emoji_id;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $needs_repainting;
|
||||
|
||||
/**
|
||||
* @var int|null
|
||||
*/
|
||||
|
@ -212,6 +217,17 @@
|
|||
return $this->custom_emoji_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional. True, if the sticker must be repainted to a text color in messages, the color of the Telegram
|
||||
* Premium badge in emoji status, white color on chat photos, or another appropriate color in other places
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function needsRepainting(): bool
|
||||
{
|
||||
return $this->needs_repainting;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional. File size in bytes
|
||||
*
|
||||
|
@ -243,6 +259,7 @@
|
|||
'premium_animation' => ($this->premium_animation instanceof ObjectTypeInterface) ? $this->premium_animation->toArray() : $this->thumb,
|
||||
'mask_position' => ($this->mask_position instanceof ObjectTypeInterface) ? $this->mask_position->toArray() : $this->mask_position,
|
||||
'custom_emoji_id' => $this->custom_emoji_id,
|
||||
'needs_repainting' => $this->needs_repainting,
|
||||
'file_size' => $this->file_size,
|
||||
];
|
||||
}
|
||||
|
@ -270,6 +287,7 @@
|
|||
$object->premium_animation = isset($data['premium_animation']) ? File::fromArray($data['premium_animation']) : null;
|
||||
$object->mask_position = isset($data['mask_position']) ? MaskPosition::fromArray($data['mask_position']) : null;
|
||||
$object->custom_emoji_id = $data['custom_emoji_id'] ?? null;
|
||||
$object->needs_repainting = $data['needs_repainting'] ?? false;
|
||||
$object->file_size = $data['file_size'] ?? null;
|
||||
|
||||
return $object;
|
||||
|
|
Loading…
Add table
Reference in a new issue