diff --git a/mirzaev/vk/system/robots/group.php b/mirzaev/vk/system/robots/group.php index 9f644ad..f34a04e 100644 --- a/mirzaev/vk/system/robots/group.php +++ b/mirzaev/vk/system/robots/group.php @@ -4,8 +4,9 @@ declare(strict_types=1); namespace mirzaev\vk\robots; -use mirzaev\vk\robots\robot; -use mirzaev\vk\api\longpoll; +use mirzaev\vk\robots\robot, + mirzaev\vk\api\settings as api, + mirzaev\vk\api\longpoll; use Throwable; use Exception; @@ -29,6 +30,18 @@ final class group extends robot */ protected longpoll $longpoll; + /** + * Конструктор + * + * @param int|null $id Идентификатор + * @param string|null $key Ключ + */ + public function __construct( + protected int|null $id = null, + protected string|null $key = null + ) { + parent::__construct($id, $key); + } /** * Запись свойства * diff --git a/mirzaev/vk/system/robots/robot.php b/mirzaev/vk/system/robots/robot.php index f24c637..a968e99 100644 --- a/mirzaev/vk/system/robots/robot.php +++ b/mirzaev/vk/system/robots/robot.php @@ -55,16 +55,6 @@ abstract class robot */ private account $account; - /** - * Прокси - */ - protected proxy $proxy; - - /** - * Обработчик капчи - */ - protected captcha $captcha; - /** * $messages_mode Режим отправки сообщений */ @@ -122,34 +112,6 @@ abstract class robot return $this; } - /** - * Инициализация прокси - * - * @param proxy $proxy Прокси - * - * @return self - */ - public function proxy(proxy $proxy): self - { - $this->__set('proxy', $proxy); - - return $this; - } - - /** - * Инициализация обработчика капчи - * - * @param captcha $captcha Обработчик капчи - * - * @return self - */ - public function captcha(captcha $captcha): self - { - $this->__set('captcha', $captcha); - - return $this; - } - /** * Записать свойство * @@ -167,8 +129,6 @@ abstract class robot 'api' => isset($this->api) ? throw new Exception('Запрещено перезаписывать API', 500) : $this->api = $value, 'account' => isset($this->account) ? throw new Exception('Запрещено перезаписывать аккаунт', 500) : $this->account = $value, 'browser' => isset($this->browser) ? throw new Exception('Запрещено перезаписывать браузер', 500) : $this->browser = $value, - 'proxy' => $this->proxy = $value, - 'captcha' => $this->captcha = $value, 'messages_new' => $this->messages_new = (int) $value, default => throw new Exception("Свойство $name не найдено", 404) }; @@ -193,8 +153,6 @@ abstract class robot 'base_uri' => 'https://api.vk.com/method/', 'cookies' => true ]), - 'proxy' => $this->proxy, - 'captcha' => $this->captcha, 'messages_new' => $this->messages_new, default => throw new Exception("Свойство $name не найдено", 404) }; @@ -216,8 +174,6 @@ abstract class robot 'account' => isset($this->account), 'api' => isset($this->api), 'browser' => isset($this->browser), - 'proxy' => isset($this->proxy), - 'captcha' => isset($this->captcha), 'messages_new' => isset($this->messages_new), default => throw new Exception("Свойство $name не найдено", 404) };