From 27d1dce80f6d3334675eeff7f8e1bf3510838642 Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 1 Nov 2024 15:46:39 -0400 Subject: [PATCH] Add ChatBoostUpdated object --- src/TgBotLib/Objects/ChatBoostUpdated.php | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/TgBotLib/Objects/ChatBoostUpdated.php diff --git a/src/TgBotLib/Objects/ChatBoostUpdated.php b/src/TgBotLib/Objects/ChatBoostUpdated.php new file mode 100644 index 0000000..3bb209b --- /dev/null +++ b/src/TgBotLib/Objects/ChatBoostUpdated.php @@ -0,0 +1,45 @@ +chat; + } + + public function getBoost(): ChatBoost + { + return $this->boost; + } + + /** + * @inheritDoc + */ + public function toArray(): ?array + { + return [ + 'chat' => $this->chat->toArray(), + 'boost' => $this->boost->toArray() + ]; + } + + /** + * @inheritDoc + */ + public static function fromArray(?array $data): ?ChatBoostUpdated + { + $object = new self(); + + $object->chat = Chat::fromArray($data['chat']); + $object->boost = ChatBoost::fromArray($data['boost']); + + return $object; + } + } \ No newline at end of file