From d60e7315c36e755d34c0a6139ad6d4cdc1c01402 Mon Sep 17 00:00:00 2001 From: Netkas Date: Sun, 12 Feb 2023 18:41:37 -0500 Subject: [PATCH] Added \TgBotLib\Objects > ForumTopicCreated --- src/TgBotLib/Objects/ForumTopicCreated.php | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/TgBotLib/Objects/ForumTopicCreated.php diff --git a/src/TgBotLib/Objects/ForumTopicCreated.php b/src/TgBotLib/Objects/ForumTopicCreated.php new file mode 100644 index 0000000..218f737 --- /dev/null +++ b/src/TgBotLib/Objects/ForumTopicCreated.php @@ -0,0 +1,83 @@ +name; + } + + /** + * Color of the topic icon in RGB format + * + * @return int + */ + public function getIconColor(): int + { + return $this->icon_color; + } + + /** + * Optional. Unique identifier of the custom emoji shown as the topic icon + * + * @return string|null + */ + public function getIconCustomEmojiId(): ?string + { + return $this->icon_custom_emoji_id; + } + + /** + * Returns an array representation of the object. + * + * @return array + */ + public function toArray(): array + { + return [ + 'name' => $this->name, + 'icon_color' => $this->icon_color, + 'icon_custom_emoji_id' => $this->icon_custom_emoji_id, + ]; + } + + /** + * Constructs the object from an array representation. + * + * @param array $data + * @return ObjectTypeInterface + */ + public static function fromArray(array $data): ObjectTypeInterface + { + $object = new self(); + $object->name = @$data['name']; + $object->icon_color = @$data['icon_color']; + $object->icon_custom_emoji_id = @$data['icon_custom_emoji_id'] ?? null; + + return $object; + } + } \ No newline at end of file