diff --git a/src/TgBotLib/Objects/BotCommandScope/BotCommandScopeDefault.php b/src/TgBotLib/Objects/BotCommandScope/BotCommandScopeDefault.php new file mode 100644 index 0000000..de30538 --- /dev/null +++ b/src/TgBotLib/Objects/BotCommandScope/BotCommandScopeDefault.php @@ -0,0 +1,68 @@ +type; + } + + /** + * Returns an array representation of the object + * + * @return string[] + */ + public function toArray(): array + { + return [ + 'type' => $this->type + ]; + } + + /** + * Constructs object from an array representation + * + * @param array $data + * @return ObjectTypeInterface + */ + public static function fromArray(array $data): ObjectTypeInterface + { + $object = new self(); + + $object->type = $data['type']; + + return $object; + } + + /** + * Constructs object from BotCommandScope + * + * @param BotCommandScope $botCommandScope + * @return BotCommandScopeDefault + */ + public static function fromBotCommandScope(BotCommandScope $botCommandScope): BotCommandScopeDefault + { + $object = new self(); + + $object->type = $botCommandScope->getType(); + + return $object; + } + } \ No newline at end of file