diff --git a/src/TgBotLib/Objects/UserChatBoosts.php b/src/TgBotLib/Objects/UserChatBoosts.php new file mode 100644 index 0000000..8b4e042 --- /dev/null +++ b/src/TgBotLib/Objects/UserChatBoosts.php @@ -0,0 +1,49 @@ +boosts; + } + + /** + * @inheritDoc + */ + public function toArray(): ?array + { + return [ + 'boosts' => array_map(fn(ChatBoost $item) => $item->toArray(), $this->boosts) + ]; + } + + /** + * @inheritDoc + */ + public static function fromArray(?array $data): ?UserChatBoosts + { + if($data === null) + { + return null; + } + + $object = new self(); + $object->boosts = array_map(fn(array $item) => ChatBoost::fromArray($item), $data['boosts']); + + return $object; + } + } \ No newline at end of file