From 7bf5939a07e00f875a7dd80db49f10c5508c8ef5 Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 4 Oct 2024 12:38:08 -0400 Subject: [PATCH] Added BusinessIntro --- src/TgBotLib/Objects/BusinessIntro.php | 72 ++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/TgBotLib/Objects/BusinessIntro.php diff --git a/src/TgBotLib/Objects/BusinessIntro.php b/src/TgBotLib/Objects/BusinessIntro.php new file mode 100644 index 0000000..dabfcf7 --- /dev/null +++ b/src/TgBotLib/Objects/BusinessIntro.php @@ -0,0 +1,72 @@ +title; + } + + /** + * Optional. Message text of the business intro + * + * @return string|null + */ + public function getMessage(): ?string + { + return $this->message; + } + + /** + * Optional. Sticker of the business intro + * + * @return Sticker|null + */ + public function getSticker(): ?Sticker + { + return $this->sticker; + } + + /** + * @inheritDoc + */ + public function toArray(): ?array + { + return [ + 'title' => $this->title, + 'message' => $this->message, + 'sticker' => $this->sticker?->toArray() + ]; + } + + /** + * @inheritDoc + */ + public static function fromArray(?array $data): ?ObjectTypeInterface + { + if($data === null) + { + return null; + } + + $object = new self(); + $object->title = $data['title'] ?? null; + $object->message = $data['message'] ?? null; + $object->sticker = Sticker::fromArray($data['sticker']) ?? null; + + return $object; + } + } \ No newline at end of file