From 02d9fe69d98d7071ff5d46955c02fa09bd4b5468 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 9 Oct 2024 13:13:28 -0400 Subject: [PATCH] Added BotName --- src/TgBotLib/Objects/BotName.php | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/TgBotLib/Objects/BotName.php diff --git a/src/TgBotLib/Objects/BotName.php b/src/TgBotLib/Objects/BotName.php new file mode 100644 index 0000000..5a29823 --- /dev/null +++ b/src/TgBotLib/Objects/BotName.php @@ -0,0 +1,46 @@ +name; + } + + /** + * @inheritDoc + */ + public function toArray(): ?array + { + return [ + 'name' => $this->name + ]; + } + + /** + * @inheritDoc + */ + public static function fromArray(?array $data): ?BotName + { + if($data === null) + { + return null; + } + + $object = new self(); + $object->name = $data['name']; + + return $object; + } + } \ No newline at end of file