Compare commits

..

25 Commits

Author SHA1 Message Date
Arsen Mirzaev Tatyano-Muradovich c61e7a0de5 Добавлен messages.getHistory и полностью переработаны остальные методы 2022-11-14 03:06:52 +10:00
Arsen Mirzaev Tatyano-Muradovich 39d13d9020 Большая доработка сообщений 2022-11-10 23:15:06 +10:00
Arsen Mirzaev Tatyano-Muradovich e670be5816 Полное изменение enum! 2022-11-09 01:12:50 +10:00
Arsen Mirzaev Tatyano-Muradovich e08f252d5b Доработка messages.send и users.get + settings::__isset + settings::__unset() 2022-11-08 17:35:52 +10:00
Arsen Mirzaev Tatyano-Muradovich 5bd94e5ca3 Добавлено: удаление сообщений, информация об аккаунте и профиле 2022-11-08 02:06:13 +10:00
Arsen Mirzaev Tatyano-Muradovich d8750b6153 fix offsetSet 2022-11-07 14:19:43 +10:00
Arsen Mirzaev Tatyano-Muradovich 1f975c1d12 mirzaev/accounts (~1.2.x-dev -> ~1.2.0) 2022-11-06 09:52:40 +10:00
Arsen Mirzaev Tatyano-Muradovich f7eac34483 Обновление для переноса сервера репозитория 2022-10-27 15:53:54 +10:00
Arsen Mirzaev Tatyano-Muradovich e23e6436b2 Исправление offsetSet и README 2022-10-27 15:01:04 +10:00
Arsen Mirzaev Tatyano-Muradovich 850a4bbd8e guzzle update 2022-10-24 03:22:42 +10:00
Arsen Mirzaev Tatyano-Muradovich 15f4979cf7 Просто замена автора 2022-10-24 02:55:26 +10:00
Arsen Mirzaev Tatyano-Muradovich c7fe3623e7 Начало перехода на PHP 8.1 2022-05-11 04:31:58 +10:00
Arsen Mirzaev Tatyano-Muradovich 07ace039c9 Какое-то старое говно не помню 2022-04-06 04:11:51 +10:00
Arsen Mirzaev Tatyano-Muradovich 64a88c9f4e Удаление устаревших данных 2021-07-28 18:00:49 +10:00
Arsen Mirzaev Tatyano-Muradovich 31df94665a Ничего серьёзного)) 2021-07-28 17:55:53 +10:00
Arsen Mirzaev Tatyano-Muradovich d307d4220e Небольшое исправление LongPoll 2021-07-28 17:50:27 +10:00
Arsen Mirzaev Tatyano-Muradovich 2f9352fb13 Обновление README 2021-07-27 15:29:47 +10:00
Arsen Mirzaev Tatyano-Muradovich b7bdd2078b !.gitignore 2021-07-27 15:19:30 +10:00
Arsen Mirzaev Tatyano-Muradovich a1d0837d86 Удалил говно 2021-07-27 15:14:45 +10:00
Arsen Mirzaev Tatyano-Muradovich 864ea8ca6d Ещё исправления и тест + нашел мусор Кости 2021-07-27 15:09:33 +10:00
Arsen Mirzaev Tatyano-Muradovich 19f5275fe9 Продолжаю исправлять + тест репозитория 2021-07-27 14:51:14 +10:00
Arsen Mirzaev Tatyano-Muradovich 085974f740 Исправления после ошибок слияния 2021-07-27 14:44:35 +10:00
Arsen Mirzaev Tatyano-Muradovich 4840041054 Merge tag '3.3.0' of https://git.hood.su/mirzaev/vk into stable 2021-07-27 12:14:56 +10:00
Arsen Mirzaev Tatyano-Muradovich 3703a61e5c Исправления 2021-03-10 12:11:07 +10:00
Arsen Mirzaev Tatyano-Muradovich b769c682d1 Merge branch '3.3.x' of https://git.hood.su/hood/vk into stable 2021-03-10 11:49:21 +10:00
34 changed files with 2386 additions and 883 deletions

6
.gitignore vendored
View File

@ -1,3 +1,3 @@
/logs
/temp
/vendor
!.gitignore
composer.phar
vendor

22
LICENSE
View File

@ -1,22 +0,0 @@
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Это свободная программа: вы можете перераспространять ее и/или изменять
ее на условиях Стандартной общественной лицензии GNU в том виде, в каком
она была опубликована Фондом свободного программного обеспечения; либо
версии 3 лицензии, либо (по вашему выбору) любой более поздней версии.
Эта программа распространяется в надежде, что она будет полезной,
но БЕЗО ВСЯКИХ ГАРАНТИЙ; даже без неявной гарантии ТОВАРНОГО ВИДА
или ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЕННЫХ ЦЕЛЕЙ. Подробнее см. в Стандартной
общественной лицензии GNU <https://www.gnu.org/licenses/>.

View File

@ -1,24 +1,30 @@
# Колпачный фреймворк для ВКонтакте
Развивается как многопоточный фреймворк с поддержкой всех возможностей API ВКонтакте, а так же не добавленных, но необходимых функций, работу с большим количеством роботов под разными сессиями, поддерживающий PSR-спецификацию и полностью покрытый тестами
# PHP-фреймворк ВКонтакте
Многопоточный фреймворк с поддержкой всех возможностей API ВКонтакте
### Установка:
```sh
$ composer install hood/vk
$ composer install mirzaev/vk
```
### Пример использования:
```php
use hood\vk\core;
use hood\accounts\vk;
use mirzaev\vk\core;
use mirzaev\accounts\vk;
// Подключение библеотек
require_once './vendor/autoload.php';
// Инициализация пользователя ВКонтакте
$account = (new vk($id))->auth('login', 'password')->key($project_id);
// Инициализация ядра
$core = core::init();
// Инициализация менеджера аккаунтов ВКонтакте
$vk = new vk(ACCOUNT_ID);
// Инициализация аккаунта ВКонтакте
$account = $vk->auth(ACCOUNT_LOGIN, ACCOUNT_PASSWORD)->key(PROJECT_KEY);
// Инициализация робота-группы
$robot = core::init()->group($account);
$robot = $core->group($account);
// Отправка сообщения
$robot->message($to, 'Привет, я создал робота!');
```
$robot->message(RECEIVER_ID, 'Привет, я создал робота!');
```

View File

@ -1,40 +1,39 @@
{
"name": "mirzaev/vk",
"type": "framework",
"description": "Фреймворк VK API",
"description": "Framework for vk.com API",
"readme": "README.md",
"keywords": [
"vk",
"api"
],
"homepage": "https://git.hood.su/mirzaev/vk",
"homepage": "https://git.mirzaev.sexy/mirzaev/vk",
"license": "WTFPL",
"authors": [
{
"name": "Arsen Mirzaev Tatyano-Muradovich",
"email": "red@hood.su",
"homepage": "https://hood.su/mirzaev",
"role": "Programmer"
},
{
"name": "Konstantin Tarashchansky Eleno-Borisovich",
"homepage": "https://hood.su/flower_studios",
"email": "arsen@mirzaev.sexy",
"homepage": "https://mirzaev.sexy/mirzaev",
"role": "Programmer"
}
],
"support": {
"docs": "https://git.hood.su/mirzaev/vk/manual",
"issues": "https://git.hood.su/mirzaev/vk/issues"
"docs": "https://git.mirzaev.sexy/mirzaev/vk/wiki",
"issues": "https://git.mirzaev.sexy/mirzaev/vk/issues"
},
"require": {
"php": "~8.0",
"psr/log": "~1.0",
"mirzaev/accounts": "~0.1.x-dev",
"monolog/monolog": "~1.6",
"jasny/error-handler": "~0.2",
"guzzlehttp/guzzle": "~7.2"
"php": "^8.1",
"psr/log": "^1.0",
"mirzaev/accounts": "^1.2.0",
"monolog/monolog": "^1.6",
"jasny/error-handler": "^0.2",
"guzzlehttp/guzzle": "^7.5"
},
"require-dev": {
"phpunit/phpunit": "~9.5"
"phpunit/phpunit": "^9.5"
},
"suggest": {
"ext-sodium": "Can be selected in some conditions to increase security"
},
"autoload": {
"psr-4": {

791
composer.lock generated

File diff suppressed because it is too large Load Diff

2
mirzaev/vk/logs/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/*
!.gitignore

View File

@ -0,0 +1,18 @@
[2020-10-07 16:14:21] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined method Hood\VK\Robots\Group::token() in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 {main} thrown in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:08:57] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined method Hood\VK\Robots\Group::token() in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 {main} thrown in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:09:35] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined method Hood\VK\Robots\Group::token() in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 {main} thrown in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:16:23] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught TypeError: Argument 3 passed to Hood\VK\Robots\Group::message() must be of the type string, int given, called in D:\Проектs\Репозитории\s.php on line 63 and defined in D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php:54 Stack trace: #0 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->message() #1 D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php(262): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(66): Hood\VK\API\LongPoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php:54 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:41:46] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\RobotAbstract::$id must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:132 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php(131): Hood\VK\Robots\RobotAbstract->__get() #1 D:\Проектs\Репозитории\vk\Hood\VK\Builder.php(85): Hood\VK\Robots\User->__get() #2 D:\Проектs\Репозитории\vk\Hood\VK\Builder.php(70): Hood\VK\Builder->reg() #3 D:\Проектs\Репозитории\s.php(68): Hood\VK\Builder->user() #4 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:132 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:42:08] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\RobotAbstract::$id must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:132 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php(131): Hood\VK\Robots\RobotAbstract->__get() #1 D:\Проектs\Репозитории\vk\Hood\VK\Builder.php(85): Hood\VK\Robots\User->__get() #2 D:\Проектs\Репозитории\vk\Hood\VK\Builder.php(70): Hood\VK\Builder->reg() #3 D:\Проектs\Репозитории\s.php(68): Hood\VK\Builder->user() #4 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:132 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:43:15] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\RobotAbstract::$id must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php:80 Stack trace: #0 D:\Проектs\Репозитории\s.php(68): Hood\VK\Robots\User->key() #1 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:43:24] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php:81 Stack trace: #0 D:\Проектs\Репозитории\s.php(68): Hood\VK\Robots\User->key() #1 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php:81 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:45:29] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать ключ для доступа к LongPoll in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:45:45] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать ключ для доступа к LongPoll in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:46:24] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\RobotAbstract::$key must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:136 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(125): Hood\VK\Robots\RobotAbstract->__get() #1 D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php(79): Hood\VK\Robots\Group->__get() #2 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #3 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #4 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:136 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:46:31] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:46:40] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\RobotAbstract::$key must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:136 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(125): Hood\VK\Robots\RobotAbstract->__get() #1 D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php(79): Hood\VK\Robots\Group->__get() #2 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #3 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #4 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:136 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:47:25] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:47:31] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:47:33] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:47:50] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:48:46] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []

View File

@ -0,0 +1,46 @@
[2020-10-07 15:30:17] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 15:30:17] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 15:31:09] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 15:31:09] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 16:14:21] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 16:14:21] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:08:57] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:08:57] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:09:35] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:09:35] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:16:08] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:16:23] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:16:50] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:22:23] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:24:52] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:25:12] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:32:26] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:36:51] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:41:46] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:41:46] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:42:08] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:42:08] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:43:15] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:43:15] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:43:24] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:43:24] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:45:29] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:45:29] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:45:44] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:45:45] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:46:24] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:46:24] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:46:31] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:46:31] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:46:40] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:46:40] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:47:25] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:47:25] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:47:31] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:47:31] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:47:33] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:47:33] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:47:50] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:47:50] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:48:46] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:48:46] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []

View File

@ -0,0 +1,64 @@
[2020-10-07 15:30:17] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 15:30:17] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 15:31:09] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 15:31:09] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 16:14:21] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 16:14:21] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined method Hood\VK\Robots\Group::token() in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 {main} thrown in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 16:14:21] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:08:57] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:08:57] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined method Hood\VK\Robots\Group::token() in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 {main} thrown in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:08:57] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:09:35] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:09:35] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined method Hood\VK\Robots\Group::token() in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 {main} thrown in D:\Проектs\Репозитории\s.php:58 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:09:35] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:16:08] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:16:23] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught TypeError: Argument 3 passed to Hood\VK\Robots\Group::message() must be of the type string, int given, called in D:\Проектs\Репозитории\s.php on line 63 and defined in D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php:54 Stack trace: #0 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->message() #1 D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php(262): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(66): Hood\VK\API\LongPoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php:54 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:16:23] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:16:50] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:22:23] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:24:52] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:25:12] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:32:26] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:36:51] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:41:46] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:41:46] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\RobotAbstract::$id must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:132 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php(131): Hood\VK\Robots\RobotAbstract->__get() #1 D:\Проектs\Репозитории\vk\Hood\VK\Builder.php(85): Hood\VK\Robots\User->__get() #2 D:\Проектs\Репозитории\vk\Hood\VK\Builder.php(70): Hood\VK\Builder->reg() #3 D:\Проектs\Репозитории\s.php(68): Hood\VK\Builder->user() #4 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:132 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:41:46] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:42:08] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:42:08] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\RobotAbstract::$id must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:132 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php(131): Hood\VK\Robots\RobotAbstract->__get() #1 D:\Проектs\Репозитории\vk\Hood\VK\Builder.php(85): Hood\VK\Robots\User->__get() #2 D:\Проектs\Репозитории\vk\Hood\VK\Builder.php(70): Hood\VK\Builder->reg() #3 D:\Проектs\Репозитории\s.php(68): Hood\VK\Builder->user() #4 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:132 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:42:08] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:43:15] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:43:15] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\RobotAbstract::$id must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php:80 Stack trace: #0 D:\Проектs\Репозитории\s.php(68): Hood\VK\Robots\User->key() #1 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:43:15] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:43:24] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:43:24] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php:81 Stack trace: #0 D:\Проектs\Репозитории\s.php(68): Hood\VK\Robots\User->key() #1 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\User.php:81 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:43:24] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:45:29] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:45:29] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать ключ для доступа к LongPoll in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:45:29] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:45:44] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:45:45] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать ключ для доступа к LongPoll in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:45:45] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:46:24] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:46:24] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\RobotAbstract::$key must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:136 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(125): Hood\VK\Robots\RobotAbstract->__get() #1 D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php(79): Hood\VK\Robots\Group->__get() #2 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #3 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #4 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:136 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:46:24] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:46:31] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:46:31] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:46:31] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:46:40] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:46:40] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\RobotAbstract::$key must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:136 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(125): Hood\VK\Robots\RobotAbstract->__get() #1 D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php(79): Hood\VK\Robots\Group->__get() #2 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #3 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #4 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:136 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:46:40] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:47:25] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:47:25] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:47:25] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:47:31] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:47:31] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:47:31] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:47:33] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:47:33] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:47:33] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:47:50] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:47:50] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:78 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:47:50] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-07 17:48:46] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-07 17:48:46] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-07 17:48:46] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []

View File

@ -0,0 +1,35 @@
[2020-10-08 09:06:40] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:11:12] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:11:35] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\Group::$longpoll must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php:133 Stack trace: #0 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #1 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php:133 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:11:41] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:12:35] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:12:45] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:12:51] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(62): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:13:05] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:13:34] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:13:39] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:13:55] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:14:01] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:18:47] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: syntax error, unexpected ';', expecting ')' in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:161 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:21:22] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Call to a member function postShutdownHandler() on null in D:\Проектs\Репозитории\vk\core.php:111 Stack trace: #0 D:\Проектs\Репозитории\s.php(56): hood\vk\core->log() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:111 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:21:34] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Call to a member function postShutdownHandler() on null in D:\Проектs\Репозитории\vk\core.php:111 Stack trace: #0 D:\Проектs\Репозитории\s.php(56): hood\vk\core->log() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:111 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:27:33] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined function \hood\vk\api\methods\messages() in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 D:\Проектs\Репозитории\s.php(62): hood\vk\Robots\robot->__call() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(64): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:28:35] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Return value of hood\vk\Robots\robot::__call() must be an instance of hood\vk\api\methods\method, instance of hood\vk\api\methods\messages returned in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 D:\Проектs\Репозитории\s.php(62): hood\vk\Robots\robot->__call() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(64): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:29:12] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Return value of hood\vk\Robots\robot::__call() must be an instance of hood\vk\api\methods\method, instance of hood\vk\api\methods\messages returned in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 D:\Проектs\Репозитории\s.php(62): hood\vk\Robots\robot->__call() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(64): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:42:46] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Argument 1 passed to hood\vk\api\methods\messages::__construct() must be of the type string, object given, called in D:\Проектs\Репозитории\vk\robots\robot.php on line 179 and defined in D:\Проектs\Репозитории\vk\api\methods\messages.php:30 Stack trace: #0 D:\Проектs\Репозитории\vk\robots\robot.php(179): hood\vk\api\methods\messages->__construct() #1 D:\Проектs\Репозитории\s.php(67): hood\vk\Robots\robot->__call() #2 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #3 D:\Проектs\Репозитории\s.php(82): hood\vk\api\longpoll->handle() #4 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:30 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 15:02:53] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Argument 2 passed to hood\vk\api\methods\messages::__construct() must be of the type string, array given, called in D:\Проектs\Репозитории\vk\robots\robot.php on line 179 and defined in D:\Проектs\Репозитории\vk\api\methods\messages.php:44 Stack trace: #0 D:\Проектs\Репозитории\vk\robots\robot.php(179): hood\vk\api\methods\messages->__construct() #1 D:\Проектs\Репозитории\s.php(64): hood\vk\Robots\robot->__call() #2 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #3 D:\Проектs\Репозитории\s.php(66): hood\vk\api\longpoll->handle() #4 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:44 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 15:03:25] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Typed property hood\vk\api\methods\messages::$robot must not be accessed before initialization in D:\Проектs\Репозитории\vk\api\methods\messages.php:83 Stack trace: #0 D:\Проектs\Репозитории\s.php(64): hood\vk\api\methods\messages->send() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(66): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:83 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 15:04:49] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Typed property hood\vk\api\methods\messages::$robot must not be accessed before initialization in D:\Проектs\Репозитории\vk\api\methods\messages.php:83 Stack trace: #0 D:\Проектs\Репозитории\s.php(64): hood\vk\api\methods\messages->send() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(66): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:83 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 15:05:23] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Cannot access uninitialized non-nullable property hood\vk\api\methods\messages::$attachments by reference in D:\Проектs\Репозитории\vk\api\methods\messages.php:114 Stack trace: #0 D:\Проектs\Репозитории\s.php(64): hood\vk\api\methods\messages->send() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(66): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:114 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 15:06:40] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Cannot access uninitialized non-nullable property hood\vk\api\methods\messages::$attachments by reference in D:\Проектs\Репозитории\vk\api\methods\messages.php:114 Stack trace: #0 D:\Проектs\Репозитории\s.php(64): hood\vk\api\methods\messages->send() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(66): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:114 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:14:13] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Class 'Hood\VK\robots\user' not found in D:\Проектs\Репозитории\vk\builder.php:70 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): Hood\VK\builder->user() #1 {main} thrown in D:\Проектs\Репозитории\vk\builder.php:70 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:44:26] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Argument 2 passed to hood\vk\core::__call() must be of the type int, array given, called in D:\Проектs\Репозитории\s.php on line 69 and defined in D:\Проектs\Репозитории\vk\core.php:87 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): hood\vk\core->__call() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:87 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:56:29] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Argument 1 passed to hood\vk\Robots\robot::__construct() must be of the type int, object given, called in D:\Проектs\Репозитории\vk\core.php on line 91 and defined in D:\Проектs\Репозитории\vk\robots\robot.php:87 Stack trace: #0 D:\Проектs\Репозитории\vk\core.php(91): hood\vk\Robots\robot->__construct() #1 D:\Проектs\Репозитории\s.php(69): hood\vk\core->__call() #2 {main} thrown in D:\Проектs\Репозитории\vk\robots\robot.php:87 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:56:39] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Return value of hood\vk\core::__call() must be an instance of hood\vk\Robots\robot, none returned in D:\Проектs\Репозитории\vk\core.php:95 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): hood\vk\core->__call() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:95 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:57:57] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать адрес сервера in D:\Проектs\Репозитории\vk\robots\user.php:80 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): hood\vk\robots\user->key() #1 {main} thrown in D:\Проектs\Репозитории\vk\robots\user.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:58:08] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Class 'hood\vk\Exception' not found in D:\Проектs\Репозитории\vk\core.php:93 Stack trace: #0 D:\Проектs\Репозитории\s.php(58): hood\vk\core->__call() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:93 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:58:26] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Exception: Не найден робот: build in D:\Проектs\Репозитории\vk\core.php:94 Stack trace: #0 D:\Проектs\Репозитории\s.php(58): hood\vk\core->__call() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:94 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 17:05:01] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать адрес сервера in D:\Проектs\Репозитории\vk\hood\vk\robots\user.php:80 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): hood\vk\robots\user->key() #1 {main} thrown in D:\Проектs\Репозитории\vk\hood\vk\robots\user.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 19:20:35] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать адрес сервера in D:\Проектs\Репозитории\vk\hood\vk\robots\user.php:80 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): hood\vk\robots\user->key() #1 {main} thrown in D:\Проектs\Репозитории\vk\hood\vk\robots\user.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 19:42:21] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined function SHAMIL\sense\core() in D:\Проектs\Репозитории\s.php:60 Stack trace: #0 {main} thrown in D:\Проектs\Репозитории\s.php:60 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 19:42:34] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined function hood\vk\core() in D:\Проектs\Репозитории\s.php:61 Stack trace: #0 {main} thrown in D:\Проектs\Репозитории\s.php:61 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []

View File

@ -0,0 +1,83 @@
[2020-10-08 09:06:39] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:06:40] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:11:12] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:11:12] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:11:35] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:11:35] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:11:41] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:11:41] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:12:35] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:12:35] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:12:45] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:12:45] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:12:51] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:12:51] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:13:05] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:13:05] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:13:34] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:13:34] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:13:39] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:13:39] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:13:55] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:13:55] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:14:01] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:14:01] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:18:47] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:18:47] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:18:59] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:19:15] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:19:20] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 12:20:33] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:20:58] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:21:22] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:21:34] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:22:09] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:27:11] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:27:23] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:27:33] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 12:28:34] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:28:35] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 12:29:10] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:29:12] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 12:30:11] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:42:41] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:42:46] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:02:25] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:02:45] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:02:53] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:03:19] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:03:25] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:04:38] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:04:49] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:05:14] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:05:23] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:06:28] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:06:40] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:07:13] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:14:13] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:14:13] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:44:26] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:44:26] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:56:29] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:56:29] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:56:39] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:56:39] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:57:57] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:57:57] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:58:08] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:58:08] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:58:26] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:58:26] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:58:45] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 17:04:09] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 17:05:01] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 17:05:01] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 19:20:35] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 19:20:35] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 19:20:49] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 19:42:21] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 19:42:21] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 19:42:34] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 19:42:34] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 19:42:42] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 19:42:42] hood\vk\loggers\jasmo.INFO: Завершение работы [] []

View File

@ -0,0 +1,118 @@
[2020-10-08 09:06:39] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:06:40] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:06:40] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:11:12] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:11:12] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:11:12] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:11:35] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:11:35] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Error: Typed property Hood\VK\Robots\Group::$longpoll must not be accessed before initialization in D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php:133 Stack trace: #0 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #1 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php:133 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:11:35] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:11:41] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:11:41] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(61): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:11:41] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:12:35] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:12:35] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:12:35] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:12:45] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:12:45] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:12:45] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:12:51] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:12:51] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(62): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:12:51] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:13:05] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:13:05] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:79 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:13:05] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:13:34] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:13:34] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:13:34] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:13:39] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:13:39] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:13:39] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:13:55] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:13:55] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:13:55] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:14:01] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:14:01] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать идентификатор ВКонтакте in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 D:\Проектs\Репозитории\vk\Hood\VK\robots\Group.php(131): Hood\VK\API\LongPoll->__construct() #1 D:\Проектs\Репозитории\s.php(63): Hood\VK\Robots\Group->__get() #2 {main} thrown in D:\Проектs\Репозитории\vk\Hood\VK\api\LongPoll.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:14:01] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:18:47] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:18:47] Hood\VK\Loggers\Jasmo.ERROR: ErrorException: syntax error, unexpected ';', expecting ')' in D:\Проектs\Репозитории\vk\Hood\VK\robots\RobotAbstract.php:161 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 09:18:47] Hood\VK\Loggers\Jasmo.INFO: Завершение работы [] []
[2020-10-08 09:18:59] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:19:15] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 09:19:20] Hood\VK\Loggers\Jasmo.INFO: Начало работы [] []
[2020-10-08 12:20:33] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:20:58] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:21:22] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:21:22] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Call to a member function postShutdownHandler() on null in D:\Проектs\Репозитории\vk\core.php:111 Stack trace: #0 D:\Проектs\Репозитории\s.php(56): hood\vk\core->log() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:111 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:21:34] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:21:34] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Call to a member function postShutdownHandler() on null in D:\Проектs\Репозитории\vk\core.php:111 Stack trace: #0 D:\Проектs\Репозитории\s.php(56): hood\vk\core->log() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:111 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:22:09] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:27:11] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:27:23] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:27:33] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined function \hood\vk\api\methods\messages() in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 D:\Проектs\Репозитории\s.php(62): hood\vk\Robots\robot->__call() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(64): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:27:33] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 12:28:34] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:28:35] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Return value of hood\vk\Robots\robot::__call() must be an instance of hood\vk\api\methods\method, instance of hood\vk\api\methods\messages returned in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 D:\Проектs\Репозитории\s.php(62): hood\vk\Robots\robot->__call() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(64): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:28:35] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 12:29:10] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:29:12] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Return value of hood\vk\Robots\robot::__call() must be an instance of hood\vk\api\methods\method, instance of hood\vk\api\methods\messages returned in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 D:\Проектs\Репозитории\s.php(62): hood\vk\Robots\robot->__call() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(64): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\robots\robot.php:179 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:29:12] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 12:30:11] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:42:41] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 12:42:46] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Argument 1 passed to hood\vk\api\methods\messages::__construct() must be of the type string, object given, called in D:\Проектs\Репозитории\vk\robots\robot.php on line 179 and defined in D:\Проектs\Репозитории\vk\api\methods\messages.php:30 Stack trace: #0 D:\Проектs\Репозитории\vk\robots\robot.php(179): hood\vk\api\methods\messages->__construct() #1 D:\Проектs\Репозитории\s.php(67): hood\vk\Robots\robot->__call() #2 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #3 D:\Проектs\Репозитории\s.php(82): hood\vk\api\longpoll->handle() #4 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:30 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 12:42:46] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:02:25] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:02:45] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:02:53] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Argument 2 passed to hood\vk\api\methods\messages::__construct() must be of the type string, array given, called in D:\Проектs\Репозитории\vk\robots\robot.php on line 179 and defined in D:\Проектs\Репозитории\vk\api\methods\messages.php:44 Stack trace: #0 D:\Проектs\Репозитории\vk\robots\robot.php(179): hood\vk\api\methods\messages->__construct() #1 D:\Проектs\Репозитории\s.php(64): hood\vk\Robots\robot->__call() #2 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #3 D:\Проектs\Репозитории\s.php(66): hood\vk\api\longpoll->handle() #4 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:44 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 15:02:53] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:03:19] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:03:25] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Typed property hood\vk\api\methods\messages::$robot must not be accessed before initialization in D:\Проектs\Репозитории\vk\api\methods\messages.php:83 Stack trace: #0 D:\Проектs\Репозитории\s.php(64): hood\vk\api\methods\messages->send() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(66): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:83 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 15:03:25] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:04:38] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:04:49] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Typed property hood\vk\api\methods\messages::$robot must not be accessed before initialization in D:\Проектs\Репозитории\vk\api\methods\messages.php:83 Stack trace: #0 D:\Проектs\Репозитории\s.php(64): hood\vk\api\methods\messages->send() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(66): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:83 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 15:04:49] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:05:14] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:05:23] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Cannot access uninitialized non-nullable property hood\vk\api\methods\messages::$attachments by reference in D:\Проектs\Репозитории\vk\api\methods\messages.php:114 Stack trace: #0 D:\Проектs\Репозитории\s.php(64): hood\vk\api\methods\messages->send() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(66): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:114 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 15:05:23] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:06:28] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 15:06:40] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Cannot access uninitialized non-nullable property hood\vk\api\methods\messages::$attachments by reference in D:\Проектs\Репозитории\vk\api\methods\messages.php:114 Stack trace: #0 D:\Проектs\Репозитории\s.php(64): hood\vk\api\methods\messages->send() #1 D:\Проектs\Репозитории\vk\api\longpoll.php(261): SHAMIL\sense\{closure}() #2 D:\Проектs\Репозитории\s.php(66): hood\vk\api\longpoll->handle() #3 {main} thrown in D:\Проектs\Репозитории\vk\api\methods\messages.php:114 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 15:06:40] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 15:07:13] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:14:13] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:14:13] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Class 'Hood\VK\robots\user' not found in D:\Проектs\Репозитории\vk\builder.php:70 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): Hood\VK\builder->user() #1 {main} thrown in D:\Проектs\Репозитории\vk\builder.php:70 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:14:13] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:44:26] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:44:26] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Argument 2 passed to hood\vk\core::__call() must be of the type int, array given, called in D:\Проектs\Репозитории\s.php on line 69 and defined in D:\Проектs\Репозитории\vk\core.php:87 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): hood\vk\core->__call() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:87 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:44:26] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:56:29] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:56:29] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Argument 1 passed to hood\vk\Robots\robot::__construct() must be of the type int, object given, called in D:\Проектs\Репозитории\vk\core.php on line 91 and defined in D:\Проектs\Репозитории\vk\robots\robot.php:87 Stack trace: #0 D:\Проектs\Репозитории\vk\core.php(91): hood\vk\Robots\robot->__construct() #1 D:\Проектs\Репозитории\s.php(69): hood\vk\core->__call() #2 {main} thrown in D:\Проектs\Репозитории\vk\robots\robot.php:87 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:56:29] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:56:39] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:56:39] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught TypeError: Return value of hood\vk\core::__call() must be an instance of hood\vk\Robots\robot, none returned in D:\Проектs\Репозитории\vk\core.php:95 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): hood\vk\core->__call() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:95 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:56:39] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:57:57] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:57:57] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать адрес сервера in D:\Проектs\Репозитории\vk\robots\user.php:80 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): hood\vk\robots\user->key() #1 {main} thrown in D:\Проектs\Репозитории\vk\robots\user.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:57:57] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:58:08] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:58:08] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Class 'hood\vk\Exception' not found in D:\Проектs\Репозитории\vk\core.php:93 Stack trace: #0 D:\Проектs\Репозитории\s.php(58): hood\vk\core->__call() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:93 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:58:08] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:58:26] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 16:58:26] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Exception: Не найден робот: build in D:\Проектs\Репозитории\vk\core.php:94 Stack trace: #0 D:\Проектs\Репозитории\s.php(58): hood\vk\core->__call() #1 {main} thrown in D:\Проектs\Репозитории\vk\core.php:94 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 16:58:26] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 16:58:45] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 17:04:09] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 17:05:01] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 17:05:01] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать адрес сервера in D:\Проектs\Репозитории\vk\hood\vk\robots\user.php:80 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): hood\vk\robots\user->key() #1 {main} thrown in D:\Проектs\Репозитории\vk\hood\vk\robots\user.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 17:05:01] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 19:20:35] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 19:20:35] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Exception: Необходимо указать адрес сервера in D:\Проектs\Репозитории\vk\hood\vk\robots\user.php:80 Stack trace: #0 D:\Проектs\Репозитории\s.php(69): hood\vk\robots\user->key() #1 {main} thrown in D:\Проектs\Репозитории\vk\hood\vk\robots\user.php:80 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 19:20:35] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 19:20:49] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 19:42:21] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 19:42:21] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined function SHAMIL\sense\core() in D:\Проектs\Репозитории\s.php:60 Stack trace: #0 {main} thrown in D:\Проектs\Репозитории\s.php:60 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 19:42:21] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 19:42:34] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 19:42:34] hood\vk\loggers\jasmo.ERROR: ErrorException: Uncaught Error: Call to undefined function hood\vk\core() in D:\Проектs\Репозитории\s.php:61 Stack trace: #0 {main} thrown in D:\Проектs\Репозитории\s.php:61 Stack trace: #0 [internal function]: Jasny\ErrorHandler->shutdownFunction() #1 {main} [] []
[2020-10-08 19:42:34] hood\vk\loggers\jasmo.INFO: Завершение работы [] []
[2020-10-08 19:42:42] hood\vk\loggers\jasmo.INFO: Начало работы [] []
[2020-10-08 19:42:42] hood\vk\loggers\jasmo.INFO: Завершение работы [] []

View File

@ -0,0 +1 @@
[2020-10-09 08:53:00] hood\vk\loggers\jasmo.INFO: Начало работы [] []

View File

@ -0,0 +1 @@
[2020-10-09 08:53:00] hood\vk\loggers\jasmo.INFO: Начало работы [] []

View File

@ -2,7 +2,7 @@
// declare(strict_types=1);
// namespace Hood\VK\API;
// namespace mirzaev\vk\API;
// class CallBack extends CallBackAbstract
// {

View File

@ -5,26 +5,28 @@ declare(strict_types=1);
namespace mirzaev\vk\api;
use Exception;
use mirzaev\vk\core,
mirzaev\vk\robots\robot;
mirzaev\vk\robots\robot,
mirzaev\vk\robots\group;
/**
* LongPoll
*
* @property string $key Ключ к серверу
* @property string $server Сервер
* @property string $ts Идентификатор последнего события
* $key Ключ к серверу
* $server Сервер
* $ts Идентификатор последнего события
*
* @method public function __construct(object $robot) Инициализация
* @method public function get(int $wait = 25) Получить события
* @method public function handle(callable $function, int $wait = 25) Обработать события
* public function __construct(object $robot) Инициализация
* public function get(int $wait = 25) Получить события
* public function handle(callable $function, int $wait = 25) Обработать события
*
* @see https://vk.com/dev/bots_longpoll
* @see https://vk.com/dev/groups.getLongPollServer
* @see https://vk.com/dev/groups.setLongPollSettings
*
* @package mirzaev\vk\api
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*
* @todo Добавить обработку ошибок ($request['errors];)
*/
@ -34,19 +36,15 @@ final class longpoll
* Ключ к серверу
*
* @see $this->get()
*
* @var string
*/
private string $key;
private readonly string $key;
/**
* Сервер (URL)
*
* @see $this->get()
*
* @var string
*/
private string $server;
private readonly string $server;
/**
* Идентификатор последнего события
@ -54,31 +52,48 @@ final class longpoll
* От него отсчитываются новые, необработанные события
*
* @see $this->get()
*
* @var string
*/
private string $ts;
/**
* Инициализация
*
* @param robot $robot Робот
* $robot Робот
*/
public function __construct(private robot $robot)
public function __construct(private robot&group $robot)
{
// Инициализация
if (empty($robot->id)) throw new Exception('Необходимо указать идентификатор ВКонтакте');
if (empty($robot->key)) throw new Exception('Необходимо указать ключ для доступа к LongPoll');
if (empty($robot->api['v'])) throw new Exception('Необходимо указать версию используемого API ВКонтакте');
if (empty($robot->api) || empty($robot->api['v'])) {
// Настройки API не инициализированы или не соблюдены условия
// Безопасная инициализация
$robot->api->init();
}
// Остановка процессов-дубликатов
if (!file_exists(core::init()->path_temp)) {
// Если не существует каталога temp, то создать
mkdir(core::init()->path_temp, 0775, true);
}
if (file_exists($lock = core::init()->path_temp . '/' . $this->robot->id . '_' . (int) $this->robot->session . '.longpoll')) {
// Если существует файл-блокировщик, то удалить его
unlink($lock);
try {
// Поиск директории для временных файлов
if (!file_exists(core::init()->path_temp)) {
// Не удалось найти директорию для временных файлов
if (!mkdir(core::init()->path_temp, 0775, true)) {
// Не удалось создать директорию для временных файлов
throw new Exception('Не удалось создать директорию для временных файлов', 500);
}
}
// Поиск файла-блокировщика
if (file_exists($lock = core::init()->path_temp . '/' . $this->robot->id . '_' . (int) $this->robot->session . '.longpoll')) {
// Удалось найти файл-блокировщик
// Удаление файла
unlink($lock);
}
} catch (Exception $e) {
throw new Exception('Не удалось обработать процессы-дубликаты', 500, $e->getPrevious());
}
}
@ -87,27 +102,24 @@ final class longpoll
*
* Полная настройка и активация LongPoll
*
* @param bool $status = true Активация или деактивация
* @param string ...$params Изменяемые параметры
*
* @return array
* $status = true Активация или деактивация
* ...$params Изменяемые параметры
*/
public function post(bool $status = true, string ...$params): array
{
// Реиницилазиция
$this->robot->api->reinit();
// Инициализация настроек
$this->robot->api['group_id'] = $this->robot->id;
$this->robot->api['access_token'] = $this->robot->key;
$this->robot->api['v'] = $this->robot->version;
$this->robot->api['api_version'] = $this->robot->version;
$settings = [
'group_id' => $this->robot->id,
'access_token' => $this->robot->key,
'v' => $this->robot->version,
'api_version' => $this->robot->version
];
if ($status === true && !array_key_exists('enabled', $this->robot->api['settings'])) {
if ($status === true && !array_key_exists('enabled', $settings)) {
// Если запущена активация и не был передан параметр статуса LongPoll
// Установка параметра активации LongPoll
$this->robot->api['enabled'] = 1;
$settings['enabled'] = 1;
}
// Установка переданных параметров
@ -124,57 +136,57 @@ final class longpoll
// Если параметр не указывает на установку всех значений
// Установка значения
$this->robot->api[$param] = $status;
$settings[$param] = $status;
} else {
// Иначе установить все значения
// Если передан параметр: установка ВСЕХ значений
$this->robot->api['message_new'] = $status;
$this->robot->api['message_reply'] = $status;
$this->robot->api['message_allow'] = $status;
$this->robot->api['message_deny'] = $status;
$this->robot->api['message_edit'] = $status;
$this->robot->api['message_typing_state'] = $status;
$this->robot->api['photo_new'] = $status;
$this->robot->api['audio_new'] = $status;
$this->robot->api['video_new'] = $status;
$this->robot->api['wall_reply_new'] = $status;
$this->robot->api['wall_reply_edit'] = $status;
$this->robot->api['wall_reply_delete'] = $status;
$this->robot->api['wall_reply_restore'] = $status;
$this->robot->api['wall_post_new'] = $status;
$this->robot->api['wall_repost'] = $status;
$this->robot->api['board_post_new'] = $status;
$this->robot->api['board_post_edit'] = $status;
$this->robot->api['board_post_restore'] = $status;
$this->robot->api['board_post_delete'] = $status;
$this->robot->api['photo_comment_new'] = $status;
$this->robot->api['photo_comment_edit'] = $status;
$this->robot->api['photo_comment_delete'] = $status;
$this->robot->api['photo_comment_restore'] = $status;
$this->robot->api['video_comment_new'] = $status;
$this->robot->api['video_comment_edit'] = $status;
$this->robot->api['video_comment_delete'] = $status;
$this->robot->api['video_comment_restore'] = $status;
$this->robot->api['market_comment_new'] = $status;
$this->robot->api['market_comment_edit'] = $status;
$this->robot->api['market_comment_delete'] = $status;
$this->robot->api['market_comment_restore'] = $status;
$this->robot->api['poll_vote_new'] = $status;
$this->robot->api['group_join'] = $status;
$this->robot->api['group_leave'] = $status;
$this->robot->api['group_change_settings'] = $status;
$this->robot->api['group_change_photo'] = $status;
$this->robot->api['group_officers_edit'] = $status;
$this->robot->api['user_block'] = $status;
$this->robot->api['user_unblock'] = $status;
$this->robot->api['like_add'] = $status;
$this->robot->api['like_remove'] = $status;
$this->robot->api['message_event'] = $status;
$settings['message_new'] = $status;
$settings['message_reply'] = $status;
$settings['message_allow'] = $status;
$settings['message_deny'] = $status;
$settings['message_edit'] = $status;
$settings['message_typing_state'] = $status;
$settings['photo_new'] = $status;
$settings['audio_new'] = $status;
$settings['video_new'] = $status;
$settings['wall_reply_new'] = $status;
$settings['wall_reply_edit'] = $status;
$settings['wall_reply_delete'] = $status;
$settings['wall_reply_restore'] = $status;
$settings['wall_post_new'] = $status;
$settings['wall_repost'] = $status;
$settings['board_post_new'] = $status;
$settings['board_post_edit'] = $status;
$settings['board_post_restore'] = $status;
$settings['board_post_delete'] = $status;
$settings['photo_comment_new'] = $status;
$settings['photo_comment_edit'] = $status;
$settings['photo_comment_delete'] = $status;
$settings['photo_comment_restore'] = $status;
$settings['video_comment_new'] = $status;
$settings['video_comment_edit'] = $status;
$settings['video_comment_delete'] = $status;
$settings['video_comment_restore'] = $status;
$settings['market_comment_new'] = $status;
$settings['market_comment_edit'] = $status;
$settings['market_comment_delete'] = $status;
$settings['market_comment_restore'] = $status;
$settings['poll_vote_new'] = $status;
$settings['group_join'] = $status;
$settings['group_leave'] = $status;
$settings['group_change_settings'] = $status;
$settings['group_change_photo'] = $status;
$settings['group_officers_edit'] = $status;
$settings['user_block'] = $status;
$settings['user_unblock'] = $status;
$settings['like_add'] = $status;
$settings['like_remove'] = $status;
$settings['message_event'] = $status;
}
}
return $this->robot->browser->request(method: 'POST', uri: 'groups.setLongPollSettings', options: $this->robot->api['settings']);
return $this->robot->browser->request(method: 'POST', uri: 'groups.setLongPollSettings', options: $settings);
}
/**
@ -189,23 +201,24 @@ final class longpoll
public function get(int $wait = 25): array
{
if (empty($this->key) || empty($this->server) || empty($this->ts)) {
// Если не инициализирован LongPoll-сервер
// Реиницилазиция
$this->robot->api->reinit();
// Инициализация настроек
$this->robot->api['group_id'] = $this->robot->id;
// LongPoll-сервер не инициализирован
// Запрос на получение доступа и данных LongPoll-сервера
$response = json_decode($this->robot->browser->request(method: 'POST', uri: 'groups.getLongPollServer', options: [
'form_params' => $this->robot->api['settings']
])->getBody()->getContents());
$response = json_decode(
$this->robot->browser->request(
method: 'POST',
uri: 'groups.getLongPollServer',
options: [
'form_params' => $this->robot->api['settings']
]
)->getBody()->getContents()
);
if (isset($response->error)) {
// Что-то сделать
var_export($response->error); die;
var_export($response->error);
die;
}
// Инициализация
@ -230,10 +243,8 @@ final class longpoll
*
* Получает и обрабатывает события
*
* @param callable $function Обработка
* @param int $wait Время ожидания новых событий (в секундах)
*
* @return array
* $function Обработка
* $wait Время ожидания новых событий (в секундах)
*/
public function handle(callable $function, int $wait = 25): array
{

View File

@ -0,0 +1,115 @@
<?php
declare(strict_types=1);
namespace mirzaev\vk\api\methods;
// Файлы проекта
use mirzaev\vk\robots\user;
// Встроенные библиотеки
use Exception;
/**
* Аккаунт
*
* @method public getInfo(?array $fields = null) Запросить информацию об аккаунте
* @method public getProfileInfo(?array $fields = null) Запросить информацию о профиле
*
* @see https://dev.vk.com/method/account
*
* @package mirzaev\vk\api
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
final class account extends method
{
/**
* Конструктор
*
* @param user $user Робот
*/
public function __construct(
protected user $robot
) {
}
/**
* Запросить информацию об аккаунте
*
* @see https://dev.vk.com/method/account.getInfo
*
* @param array $fields Выбор полей с запрашиваемой информацией (оставить пустым, если нужны все)
*
* @return ?array Информация об аккаунте, если получена
*
* @todo
* 1. Доделать
* 2. Написать обработчик ошибок возвращаемых ВКонтакте
*/
public function getInfo(array $fields = []): array
{
// Реиницилазиция
$this->robot->api->reinit();
foreach ($fields as $key => $field) {
// Перебор запрашиваемых полей с информацией
// Запись запрашиваемого поля
$this->robot->api['fields'] .= $field;
// Запись разделителя
if ($key === array_key_last($fields)) break;
else $this->robot->api['fields'] .= ', ';
}
// Запрос
$request = json_decode($this->robot->browser->request('POST', 'account.getInfo', ['form_params' => $this->robot->api->settings])->getBody()->getContents());
// Если в ответе ошибка
if (isset($request->error)) {
throw new Exception('ВКонтакте: ' . $request->error->error_msg, $request->error->error_code);
}
return $request->response;
}
/**
* Запросить информацию о профиле
*
* @see https://dev.vk.com/method/account.getProfileInfo
*
* @param array $fields Выбор полей с запрашиваемой информацией (оставить пустым, если нужны все)
*
* @return ?array Информация об аккаунте, если получена
*
* @todo
* 1. Доделать
* 2. Написать обработчик ошибок возвращаемых ВКонтакте
*/
public function getProfileInfo(array $fields = []): array
{
// Реиницилазиция
$this->robot->api->reinit();
foreach ($fields as $key => $field) {
// Перебор запрашиваемых полей с информацией
// Запись запрашиваемого поля
$this->robot->api['fields'] .= $field;
// Запись разделителя
if ($key === array_key_last($fields)) break;
else $this->robot->api['fields'] .= ', ';
}
// Запрос
$request = json_decode($this->robot->browser->request('POST', 'account.getProfileInfo', ['form_params' => $this->robot->api->settings])->getBody()->getContents());
// Если в ответе ошибка
if (isset($request->error)) {
throw new Exception('ВКонтакте: ' . $request->error->error_msg, $request->error->error_code);
}
return $request->response;
}
}

View File

@ -4,12 +4,40 @@ declare(strict_types=1);
namespace mirzaev\vk\api\methods;
use Exception;
// Файлы проекта
use mirzaev\vk\robots\robot,
mirzaev\vk\robots\group;
use mirzaev\accounts\vk;
use mirzaev\vk\robots\robot;
use mirzaev\vk\api\data;
use mirzaev\vk\robots\group;
// Встроенные библиотеки
use stdClass,
Exception;
/**
* Режимы отправки сообщений
*/
enum message_send
{
/** Обычная отправка */
case simple;
/** Проверка отправки */
case check;
}
/**
* Режимы генерации идентификатора сессии доставки сообщения
*/
enum random_id
{
/** Генерация: time() (нельзя отправить более чем 1 сообщение в секунду) */
case date;
/** Генерация: rand() */
case random;
/** Генерация: random_int(0, PHP_INT_MAX) */
case crypto;
}
/**
* Сообщение
@ -20,150 +48,570 @@ use mirzaev\vk\robots\group;
* @see https://vk.com/dev/messages.getById
*
* @package mirzaev\vk\api
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*
* @todo Доработать строгий режим отправки: проверку сообщения в беседе (не имеет ID сообщений)
*/
final class messages extends method
{
/**
* @var int $mode Режим отправки
* @var message_send $send_mode Режим отправки сообщений
*/
protected int $mode = 1;
protected message_send $send_mode = message_send::simple;
/**
* @var array[int] Сообщения для пересылки
* @var random_id $generate_mode Режим генерации идентификатора сессии доставки сообщения
*/
protected array $forward;
protected random_id $generate_mode = random_id::crypto;
/**
* @var int Сообщение для ответа
* @var int|string|array|null $peer_id Получатель
*/
protected int $reply;
protected int|string|array|null $peer_id = null;
/**
* @var string|null $text Текст
*/
protected string|null $text = null;
/**
* @var ?int $lat Географическая ширина
*/
protected ?int $lat = null;
/**
* @var ?int $long Географическая долгота
*/
protected ?int $long = null;
/**
* @var ?int $reply_to Идентификатор сообщения, на которое требуется ответить
*/
protected ?int $reply_to = null;
/**
* @var ?array $forward_messages Идентификаторы пересылаемых сообщений
*/
protected ?array $forward_messages = null;
/**
* @var ?string $sticker_id Идентификатор стикера
*/
protected ?string $sticker_id = null;
/**
* @var ?string $payload Полезная нагрузка
*/
protected ?string $payload = null;
/**
* @var bool $dont_parse_links Не создавать представление ссылки в сообщении?
*/
protected bool $dont_parse_links = false;
/**
* @var bool $disable_mentions Отключить уведомление об упоминании в сообщении?
*/
protected bool $disable_mentions = false;
/**
* @var ?string $intent Интент
*/
protected ?string $intent = null;
/**
* @var ?int $subscribe_id Число, которое будет использоваться для работы с интентами
*/
protected ?int $subscribe_id = null;
/**
* @var ?int $offset Смещение для выбора сообщений
*/
protected ?int $offset = null;
/**
* @var ?int $count Количество выбираемых сообщений
*/
protected ?int $count = null;
/**
* @var ?int $start_message_id Идентификатор сообщения от которого начнётся выборка
*/
protected ?int $start_message_id = null;
/**
* @var bool $rev Получить сообщения в хронологичном порядке? (иначе в обратном)
*/
protected bool $rev = false;
/**
* @var bool $extended Получить расширенную информацию об авторах сообщений?
*/
protected bool $extended = false;
/**
* @var ?array $fields Дополнительные запрашиваемые поля (для $extended)
*/
protected ?array $fields = null;
/**
* Конструктор
*
* @param robot $robot Робот
*/
public function __construct(protected robot $robot, mixed ...$properties)
{
// Быстрая отправка
if (!empty($properties)) $this->send(...$properties);
}
/**
* Записать: режим отправки сообщений
*
* @param message_send $send_mode Режим отправки сообщений
*
* @return static
*/
public function send_mode(message_send $send_mode): static
{
// Запись в свойство
$this->__set('send_mode', $send_mode);
return $this;
}
/**
* Записать: режим генерации идентификатора сессии доставки сообщения
*
* @param random_id $generate_mode Режим генерации идентификатора сессии доставки сообщения
*
* @return static
*/
public function generate_mode(random_id $generate_mode): static
{
// Запись в свойство
$this->__set('generate_mode', $generate_mode);
return $this;
}
/**
* Записать: получатель
*
* @param int|string|array|null $peer_id Получатель
*
* @return static
*/
public function peer_id(int|string|array|null $peer_id): static
{
// Запись в свойство
$this->__set('peer_id', $peer_id);
return $this;
}
/**
* Записать: текст
*
* @param string|null $text Текст
* @param int|string|array $destination = null
*/
public function __construct(
protected robot $robot,
protected string|null $text = null,
int|string|array $destination = null
) {
if (isset($this->text, $destination)) {
// Быстрая отправка
$this->send($destination);
}
}
/**
* Записать текст
*
* @param string $text Текст
* @return static
*/
public function text(string $text): self
public function text(string|null $text): static
{
// Записать текст
if (!isset($this->text)) {
$this->text = $text;
} else {
$this->text .= $text;
}
// Запись в свойство
$this->__set('text', $text);
return $this;
}
/**
* Записать сообщения для пересылки
* Записать: географическая ширина
*
* @param $ids Идентификаторы сообщений
* @param ?int $lat Географическая ширина
*
* @return static
*/
public function forward(...$ids): self
public function lat(?int $lat): static
{
// Запись
$this->forward = array_merge($this->forward ?? [], $ids);
// Запись в свойство
$this->__set('lat', $lat);
return $this;
}
/**
* Записать сообщение для ответа
* Записать: географическая долгота
*
* @param $id Идентификатор сообщения
* @param ?int $long Географическая долгота
*
* @return static
*/
public function reply(int $id): self
public function long(?int $long): static
{
// Запись
$this->reply = $id;
// Запись в свойство
$this->__set('long', $long);
return $this;
}
/**
* Записать: идентификатор сообщения, на которое требуется ответить
*
* @param ?int $reply_to Идентификатор сообщения, на которое требуется ответить
*
* @return static
*/
public function reply_to(?int $reply_to): static
{
// Запись в свойство
$this->__set('reply_to', $reply_to);
return $this;
}
/**
* Записать: идентификаторы пересылаемых сообщений
*
* @param ?array $forward_messages Идентификаторы пересылаемых сообщений
*
* @return static
*/
public function forward_messages(?array $forward_messages): static
{
// Запись в свойство
$this->__set('forward_messages', $forward_messages);
return $this;
}
/**
* Записать: идентификаторы пересылаемых сообщений
*
* @param ?array $forward Идентификаторы пересылаемых сообщений
*
* @return static
*/
public function forward(?array $forward): static
{
// Запись в свойство
$this->__set('forward_messages', $forward);
return $this;
}
/**
* Записать: идентификатор стикера
*
* @param ?string $sticker_id Идентификатор стикера
*
* @return static
*/
public function sticker_id(?string $sticker_id): static
{
// Запись в свойство
$this->__set('sticker_id', $sticker_id);
return $this;
}
/**
* Записать: полезная нагрузка
*
* @param ?string $payload Полезная нагрузка
*
* @return static
*/
public function payload(?string $payload): static
{
// Запись в свойство
$this->__set('payload', $payload);
return $this;
}
/**
* Записать: не создавать представление ссылки в сообщении?
*
* @param bool $dont_parse_links Не создавать представление ссылки в сообщении?
*
* @return static
*/
public function dont_parse_links(bool $dont_parse_links): static
{
// Запись в свойство
$this->__set('dont_parse_links', $dont_parse_links);
return $this;
}
/**
* Записать: отключить уведомление об упоминании в сообщении?
*
* @param bool $disable_mentions Отключить уведомление об упоминании в сообщении?
*
* @return static
*/
public function disable_mentions(bool $disable_mentions): static
{
// Запись в свойство
$this->__set('disable_mentions', $disable_mentions);
return $this;
}
/**
* Записать: интент
*
* @param ?string $intent Интент
*
* @return static
*/
public function intent(?string $intent): static
{
// Запись в свойство
$this->__set('intent', $intent);
return $this;
}
/**
* Записать: число, которое будет использоваться для работы с интентами
*
* @param ?int $subscribe_id Число, которое будет использоваться для работы с интентами
*
* @return static
*/
public function subscribe_id(?int $subscribe_id): static
{
// Запись в свойство
$this->__set('subscribe_id', $subscribe_id);
return $this;
}
/**
* Записать: смещение для выбора сообщений
*
* @param ?int $offset Смещение для выбора сообщений
*
* @return static
*/
public function offset(?int $offset): static
{
// Запись в свойство
$this->__set('offset', $offset);
return $this;
}
/**
* Записать: количество выбираемых сообщений
*
* @param ?int $count Количество выбираемых сообщений
*
* @return static
*/
public function count(?int $count): static
{
// Запись в свойство
$this->__set('count', $count);
return $this;
}
/**
* Записать: идентификатор сообщения от которого начнётся выборка
*
* @param ?int $start_message_id Идентификатор сообщения от которого начнётся выборка
*
* @return static
*/
public function start_message_id(?int $start_message_id): static
{
// Запись в свойство
$this->__set('start_message_id', $start_message_id);
return $this;
}
/**
* Записать: получить сообщения в хронологичном порядке?
*
* @param bool $rev Получить сообщения в хронологичном порядке? (иначе в обратном)
*
* @return static
*/
public function rev(bool $rev): static
{
// Запись в свойство
$this->__set('rev', $rev);
return $this;
}
/**
* Записать: получить расширенную информацию об авторах сообщений?
*
* @param bool $extended Получить расширенную информацию об авторах сообщений?
*
* @return static
*/
public function extended(bool $extended): static
{
// Запись в свойство
$this->__set('extended', $extended);
return $this;
}
/**
* Записать: дополнительные запрашиваемые поля
*
* @param ?array $fields Дополнительные запрашиваемые поля (для static::$extended)
*
* @return static
*/
public function fields(?array $fields): static
{
// Запись в свойство
$this->__set('fields', $fields);
return $this;
}
/**
* Инициализировать получателя
*
* Записывает получателя в буфер API робота
*
* @param int|string|array|null $peer_id Получатель (группа, чат, пользователь и пользователи)
*
* @return void
*/
public function receiver(int|string|array|null $peer_id = null): void
{
if (isset($peer_id)) $this->peer_id = $peer_id;
if (is_int($this->peer_id)) ($id = $this->peer_id - 2000000000) > 0 ? $this->robot->api['peer_id'] = $this->peer_id : $this->robot->api['chat_id'] = $id;
else if (is_array($this->peer_id)) $this->robot->api['peer_ids'] = implode(',', $this->peer_id);
else if (is_string($this->peer_id)) $this->robot->api['domain'] = $this->peer_id;
}
/**
* Отправить сообщение
*
* @param int|string|array $destination Получатель
* @see https://dev.vk.com/method/messages.send
*
* @see https://vk.com/dev/messages.send
* @param int|string|null $peer_id Получатель (группа, чат, пользователь и пользователи)
* @param ?string $message Сообщение
* @param ?int $lat Географическая ширина
* @param ?int $long Географическая долгота
* @param ?array $attachments Вложения
* @param ?int $reply_to Идентификатор сообщения, на которое требуется ответить
* @param ?array $forward_messages Идентификаторы пересылаемых сообщений
* @param ?forward $forward Пересылаемые сообщения (в другой чат)
* @param ?string $sticker_id Идентификатор стикера
* @param ?keyboard $keyboard Инстанция клавиатуры
* @param ?template $template Инстанция шаблона сообщения
* @param ?string $payload Полезная нагрузка
* @param bool $dont_parse_links Не создавать представление ссылки в сообщении?
* @param bool $disable_mentions Отключить уведомление об упоминании в сообщении?
* @param ?string $intent Интент
* @param ?int $subscribe_id Число, которое будет использоваться для работы с интентами
* @param ?int $random_id Идентификатор сессии доставки сообщения (защита от повторных отправок)
*
* @return array Ответ сервера
* @return int|array Идентификатор успешно отправленного сообщения или ответ сервера (подразумевается ошибка)
*
* @todo Написать обработчик ошибок возвращаемых ВКонтакте
* @todo
* 1. Написать обработчик ошибок возвращаемых ВКонтакте
* 2. Добавить параметр forward (не путать с forward_messages)
* 3. Добавить клавиатуру
* 4. Добавить шаблоны сообщений
* 5. Добавить content_source
*/
public function send(int|string|array $destination): array
{
// Идентификатор
$random_id = time();
if ($this->mode = 1) {
// Перемножение (по умолчанию)
$random_id *= rand();
}
// Реиницилазиция
public function send(
int|string|null $peer_id = null,
?string $message = null,
?int $lat = null,
?int $long = null,
?array $attachments = null,
?int $reply_to = null,
?array $forward_messages = null,
// ?forward $forward = null,
?string $sticker_id = null,
// ?keyboard $keyboard = null,
// ?template $template = null,
?string $payload = null,
bool $dont_parse_links = false,
bool $disable_mentions = false,
?string $intent = null,
?int $subscribe_id = null,
?int $random_id = null,
): int|array {
// Реинициализация настроек
$this->robot->api->reinit();
// Цель отправки
$this->robot->api->chooseDestination($destination);
// Инициализация получателя
$this->receiver($peer_id);
// Идентификатор сообщения
$this->robot->api['random_id'] = $random_id;
// Инициализация идентификатора сессии доставки сообщения (защита от повторных отправок)
$this->robot->api['random_id'] = $random_id ?? match ($this->generate_mode) {
random_id::date => time(),
random_id::random => rand(),
random_id::crypto => random_int(0, PHP_INT_MAX),
default => random_int(0, PHP_INT_MAX)
};
// Текст
$this->robot->api['message'] = $this->text;
// Инициализация текста в настройках API
if (!empty($message ??= $this->text)) $this->robot->api['message'] = $message;
// Пересылаемые сообщения
if (!empty($this->forwardMessages)) {
// Инициализация широты
if (!empty($lat ??= $this->lat)) $this->robot->api['lat'] = $lat;
$this->robot->api['forward_messages'] = implode(',', $this->forwardMessages);
}
// Инициализация долготы
if (!empty($long ??= $this->long)) $this->robot->api['long'] = $long;
// Ответные сообщения
if (isset($this->ReplyMessage)) {
// Инициализация вложений
if (!empty($attachments ??= $this->robot->api->data)) $this->robot->api['attachment'] = implode(',', $attachments);
$this->robot->api['reply_to'] = $this->ReplyMessage;
}
// Инициализация сообщения, на которое требуется ответить
if (!empty($reply_to ??= $this->reply_to)) $this->robot->api['reply_to'] = $reply_to;
// Вложения
if ( isset($this->data) && $this->__get('data') !== []) { // !empty($this->data->data) почемуто не работает
// Инициализация пересылаемых сообщений
if (!empty($forward_messages ??= $this->forward_messages)) $this->robot->api['forward_messages'] = implode(',', $forward_messages);
$this->robot->api['attachment'] = implode(',', $this->__get('data'));
}
// Инициализация стикера
if (!empty($sticker_id ??= $this->sticker_id)) $this->robot->api['sticker_id'] = $sticker_id;
// Инициализация полезной нагрузки
if (!empty($payload ??= $this->payload)) $this->robot->api['payload'] = $payload;
// Инициализация пользовательского соглашения
// $this->robot->api['content_source'] = $this->robot->content_source;
// Инициализация "не создавать представление ссылки в сообщении?"
if ($dont_parse_links || $this->dont_parse_links) $this->robot->api['dont_parse_links'] = 1;
// Инициализация "отключить уведомление об упоминании в сообщении?"
if ($disable_mentions || $this->disable_mentions) $this->robot->api['disable_mentions'] = 1;
// Инициализация интентов
if (!empty($intent ??= $this->intent)) $this->robot->api['intent'] = $intent;
// Инициализация числа, которое будет использоваться для работы с интентами
if (!empty($subscribe_id ??= $this->subscribe_id)) $this->robot->api['subscribe_id'] = $subscribe_id;
// Проверка сформированного сообщения
if (!$this->robot->api->offsetExists('message') && !$this->robot->api->offsetExists('attachment')) throw new Exception('Сообщение должно содержать текст, либо вложение');
// Запрос
$request = json_decode($this->robot->browser->request('POST', 'messages.send', ['form_params' => $this->robot->api->settings])->getBody()->getContents());
// Если в ответе ошибка
if (isset($request->error)) {
throw new Exception('Вконтакте: ' . $request->error->error_msg, $request->error->error_code);
}
// Проверка на наличие ошибок в ответе от ВКонтакте
if (isset($request->error)) throw new Exception('ВКонтакте: ' . $request->error->error_msg, $request->error->error_code);
if ($this->mode >= 2) {
// Если установлен режим 2 (усиленная проверка отправленного сообщения)
if ($this->send_mode === message_send::check) {
// Надёжная доставка сообщения
if (!empty($request["response"])) {
// Ответ получен
@ -174,7 +622,6 @@ final class messages extends method
// Запрашиваемые сообщения
$this->robot->api['message_ids'] = $request["response"];
// Запрос
if ($this->robot->browser->request('POST', 'messages.getById', ['form_params' => $this->robot->api->settings])['response']['count'] === 0) {
// Сообщения не существует
//!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ -182,7 +629,7 @@ final class messages extends method
//!!!!!!!!!!!!!!!!!!!!!!!!!
// Повторная отправка
$this->send($destination);
$this->send();
}
} else {
}
@ -192,35 +639,58 @@ final class messages extends method
}
/**
* Записать свойство
* Удалить сообщение
*
* @param string $name Название
* @param mixed $value Значение
* @see https://dev.vk.com/method/messages.delete
*
* @return void
* @param int|string|array|null $messages Получатель (message_ids + cmids)
* @param int|string|null $peer_id Идентификатор беседы
* @param bool $spam Пометить как спам?
* @param bool $delete_for_all Удалить для всех?
*
* @return int|array Идентификатор успешно отправленного сообщения или ответ сервера (подразумевается ошибка)
*
* @todo
* 1. Переделать под новую версию
* 2. Написать обработчик ошибок возвращаемых ВКонтакте
*/
public function __set(string $name, mixed $value): void
public function delete(string|int|array|null $messages = null, int|string|null $peer_id = null, bool $spam = false, bool $delete_for_all = false): stdClass
{
match ($name) {
default => throw new Exception("Свойство $name не найдено", 404)
};
}
// Реиницилазиция настроек
$this->robot->api->reinit();
/**
* Прочитать свойство
*
* @param string $name Название
*
* @return mixed
*/
public function __get(string $name): mixed
{
return match ($name) {
'text' => $this->text ?? throw new Exception('Текст не инициализирован'),
'forward' => empty($this->forward) ? throw new Exception('Сообщения для пересылки не инициализированы') : $this->forward,
'reply' => isset($this->reply) ? $this->reply : throw new Exception('Сообщение для ответа не инициализировано'),
default => throw new Exception("Свойство $name не найдено", 404)
};
if (isset($peer_id)) {
// Получен идентификатор беседы
// Инициализация идентификатора беседы
$this->robot->api['peer_id'] = $peer_id;
// Инициализация идентификаторов сообщений
$this->robot->api['cmids'] = $messages;
// Инициализация: "удалить для всех?"
$this->robot->api['delete_for_all'] = 1;
} else {
// Не получен идентификатор беседы
// Инициализация идентификаторов сообщений
$this->robot->api['message_ids'] = $messages;
// Инициализация: "удалить для всех?"
if ($delete_for_all) $this->robot->api['delete_for_all'] = 1;
}
// Инициализация: "сообщить о спаме?"
if ($spam) $this->robot->api['spam'] = $spam;
// Запрос
$request = json_decode($this->robot->browser->request('POST', 'messages.delete', ['form_params' => $this->robot->api->settings])->getBody()->getContents());
// Проверка на наличие ошибок в ответе от ВКонтакте
if (isset($request->error)) throw new Exception('ВКонтакте: ' . $request->error->error_msg, $request->error->error_code);
return $request->response;
}
/**
@ -229,11 +699,10 @@ final class messages extends method
* @param string $message_ids Идентификатор сообщения
*
* @return object Информация о сообщении
*
* @todo
* 1. Доделать, а лучше полностью переделать
*/
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// доделать
public function getById(int $message_ids): object
{
// Реиницилазиция
@ -253,11 +722,153 @@ final class messages extends method
// Запрос
$request = json_decode(($this->robot->browser->request('POST', 'messages.getById', ['form_params' => $this->robot->api->settings])->getBody()->getContents()));
// Если в ответе ошибка
if (isset($request->error)) {
throw new Exception('Вконтакте: ' . $request->error->error_msg, $request->error->error_code);
}
// Проверка на наличие ошибок в ответе от ВКонтакте
if (isset($request->error)) throw new Exception('ВКонтакте: ' . $request->error->error_msg, $request->error->error_code);
return $request->response;
}
/**
* Получить историю сообщений
*
* @see https://dev.vk.com/method/messages.getHistory
*
* @param ?int $offset Смещение для выбора сообщений
* @param ?int $count Количество выбираемых сообщений
* @param int|string|null $peer_id Получатель (группа, чат, пользователь и пользователи)
* @param ?int $start_message_id Идентификатор сообщения от которого начнётся выборка
* @param bool $rev Получить сообщения в хронологичном порядке? (иначе в обратном)
* @param bool $extended Получить расширенную информацию об авторах сообщений?
* @param ?array $fields Дополнительные запрашиваемые поля (для $extended)
*
* @return int|array Идентификатор успешно отправленного сообщения или ответ сервера (подразумевается ошибка)
*
* @todo Написать обработчик ошибок возвращаемых ВКонтакте
*/
public function getHistory(
?int $offset = null,
?int $count = null,
int|string|null $peer_id = null,
?int $start_message_id = null,
bool $rev = false,
bool $extended = false,
?array $fields = null
): object {
// Реиницилазиция
$this->robot->api->reinit();
// Инициализация смещения для выбора сообщений
if (!empty($offset ??= $this->offset)) $this->robot->api['offset'] = $offset;
// Инициализация количества выбираемых сообщений
if (!empty($count ??= $this->count)) $this->robot->api['count'] = $count;
// Инициализация получателя
$this->receiver($peer_id);
// Инициализация идентификатора сообщения от которого начнётся выборка
if (!empty($start_message_id ??= $this->start_message_id)) $this->robot->api['start_message_id'] = $start_message_id;
// Инициализация "получить сообщения в хронологичном порядке?"
if ($rev || $this->rev) $this->robot->api['rev'] = 1;
// Инициализация "получить расширенную информацию об авторах сообщений?"
if ($extended || $this->extended) $this->robot->api['extended'] = 1;
if (!empty($fields ??= $this->fields)) {
// Инициализация дополнительных запрашиваемых полей
// Инициализация значения в буфере запроса к API
$this->robot->api['fields'] = '';
foreach ($fields as $key => $field) {
// Перебор дополнительных запрашиваемых полей
// Запись в буфер запроса к API
$this->robot->api['fields'] .= $field;
// Запись разделителя
if ($key !== array_key_last($fields)) $this->robot->api['fields'] .= ', ';
}
}
// Запрос
$request = json_decode(($this->robot->browser->request('POST', 'messages.getHistory', ['form_params' => $this->robot->api->settings])->getBody()->getContents()));
// Проверка на наличие ошибок в ответе от ВКонтакте
if (isset($request->error)) throw new Exception('ВКонтакте: ' . $request->error->error_msg, $request->error->error_code);
return $request->response;
}
/**
* Записать свойство
*
* @param string $name Название
* @param mixed $value Значение
*
* @return void
*/
public function __set(string $name, mixed $value): void
{
match ($name) {
'send_mode' => $this->send_mode = $value,
'generate_mode' => $this->generate_mode = $value,
'peer_id', 'destination' => $this->peer_id = $value,
'text' => $this->text = $value,
'lat', 'latitude' => $this->lat = $value,
'long', 'longitude' => $this->long = $value,
'reply_to', 'reply', 'to' => $this->reply_to = $value,
'forward_messages' => $this->forward_messages = $value,
'sticker_id', 'sticker' => $this->sticker_id = $value,
'payload' => $this->payload = $value,
'dont_parse_links' => $this->dont_parse_links = $value,
'parse_links', 'parse' => $this->dont_parse_links = !$value,
'disable_mentions' => $this->disable_mentions = $value,
'mentions' => $this->disable_mentions = !$value,
'intent' => $this->intent = $value,
'subscribe_id' => $this->subscribe_id = $value,
'offset' => $this->offset = $value,
'count', 'amount' => $this->count = $value,
'start_message_id' => $this->start_message_id = $value,
'rev' => $this->rev = $value,
'extended' => $this->extended = $value,
'fields' => $this->fields = $value,
default => throw new Exception("Свойство $name не найдено", 404)
};
}
/**
* Прочитать свойство
*
* @param string $name Название
*
* @return mixed
*/
public function __get(string $name): mixed
{
return match ($name) {
'send_mode' => $this->send_mode,
'generate_mode' => $this->generate_mode,
'peer_id', 'destination' => $this->peer_id,
'text' => $this->text,
'lat', 'latitude' => $this->lat,
'long', 'longitude' => $this->long,
'reply_to', 'reply', 'to' => $this->reply_to,
'forward_messages' => $this->forward_messages,
'sticker_id', 'sticker' => $this->sticker_id,
'payload' => $this->payload,
'dont_parse_links', 'parse_links', 'parse' => $this->dont_parse_links,
'disable_mentions', 'mentions' => $this->disable_mentions,
'intent' => $this->intent,
'subscribe_id' => $this->subscribe_id,
'offset' => $this->offset,
'count', 'amount' => $this->count,
'start_message_id' => $this->start_message_id,
'rev' => $this->rev,
'extended' => $this->extended,
'fields' => $this->fields,
default => throw new Exception("Свойство $name не найдено", 404)
};
}
}

View File

@ -4,58 +4,12 @@ declare(strict_types=1);
namespace mirzaev\vk\api\methods;
use mirzaev\vk\robots\robot;
/**
* Абстракция метода API
*
* @method protected static put(string $url, ...$params) Создать
* @method protected static post(string $url, ...$params) Изменить
* @method protected static get(string $url, ...$params) Получить
* @method protected static delete(string $url, ...$params) Удалить
* Абстракция метода API ВКонтакте
*
* @package mirzaev\vk\api\methods
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
abstract class method
{
/**
* Создать
*
* @return array Ответ сервера
*/
public static function put(): array
{
return ['error' => 'Метод не поддерживается'];
}
/**
* Изменить
*
* @return array Ответ сервера
*/
public static function post(): array
{
return ['error' => 'Метод не поддерживается'];
}
/**
* Получить
*
* @return array Ответ сервера
*/
public static function get(): array
{
return ['error' => 'Метод не поддерживается'];
}
/**
* Удалить
*
* @return array Ответ сервера
*/
public static function delete(): array
{
return ['error' => 'Метод не поддерживается'];
}
}

View File

@ -4,11 +4,11 @@ declare(strict_types=1);
namespace mirzaev\vk\api\methods;
// Файлы проекта
use mirzaev\vk\robots\robot,
mirzaev\vk\robots\group;
use mirzaev\accounts\vk as account;
// Встроенные библиотеки
use Exception;
/**
@ -20,14 +20,14 @@ use Exception;
* @see https://vk.com/dev/messages.getById
*
* @package mirzaev\vk\api\methods
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*
* @todo Добавить обработку ошибок ($request['errors];)
* @todo Добавить обработку ошибок ($request['errors])
*/
final class photos extends method
{
/**
* Создать сообщение
* Конструктор
*
* @param robot $robot Робот
*/
@ -104,15 +104,41 @@ final class photos extends method
throw new Exception('Аккаунт не инициализирован');
}
/**
* Загрузить
*
* @param string $images
*
* @return void
*
* @todo Вынести этот мусор за Костей
*/
// public static function upload(string ...$images): void
// {
// if (count($images) > 5) {
// throw new Exception('Запрещено отправлять более 5 фотографий');
// }
// }
/**
* загрузить
*
* @todo Вынести этот мусор за Костей
*/
public static function uploadMessage(robot $robot, string $upload_url, string ...$images)
{
return $robot->browser->api($upload_url, ...$images);
}
/**
* Получить сервер для загрузки изображений
*
* @see https://vk.com/dev/photos.getUploadServer
*
* @param robot $robot Робот
* @param int|null $album_id Альбом
* @param int|group|null $group_id Группа
*
* @see https://vk.com/dev/photos.getUploadServer
*
* @return array|null Ответ сервера
*/
public static function getUploadServer(robot $robot, int|null $album_id = null, int|group|null $group_id = null): ?array
@ -149,6 +175,8 @@ final class photos extends method
/**
* Получить альбомы
*
* @see https://vk.com/dev/photos.getUploadServer
*
* @param robot $robot Робот
* @param array $album_ids = null Идентификаторы альбомов
* @param int $offset = null Смещение для выборки подмножества
@ -157,8 +185,6 @@ final class photos extends method
* @param bool $need_covers = null Активация возврата поля с обложкой альбома
* @param bool $photo_sizes = null Активация специального формата размеров фотографий
*
* @see https://vk.com/dev/photos.getUploadServer
*
* @return array Ответ сервера
*/
public static function getAlbums(robot $robot, array $album_ids = null, int $offset = null, int $count = null, bool $need_system = null, bool $need_covers = null, bool $photo_sizes = null): array
@ -291,6 +317,5 @@ final class photos extends method
$request;
// Ссылка на фото
return 'photo' . $request->response[0]->owner_id . '_' . $request->response[0]->id;
}
}

View File

@ -0,0 +1,113 @@
<?php
declare(strict_types=1);
namespace mirzaev\vk\api\methods;
// Файлы проекта
use mirzaev\vk\robots\robot;
// Встроенные библиотеки
use Exception,
stdClass;
/**
* Пользователь
*
*
* @see https://dev.vk.com/method/users
*
* @package mirzaev\vk\api
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
final class users extends method
{
/**
* Конструктор
*
* @param robot $user Робот
*/
public function __construct(
protected robot $robot
) {
}
/**
* Запросить информацию о пользователе
*
* @see https://dev.vk.com/method/users.get
*
* @param array $receiver Выбор пользователей для запроса информации (user_ids)
* @param array $fields Дополнительные запрашиваемые поля
* @param string $name_case Падеж
*
* @return stdClass|array|null Информация об аккаунте или массив с информацией об аккаунтах, если найдена
*
* @todo
* 1. Доделать
* 2. Написать обработчик ошибок возвращаемых ВКонтакте
*/
public function get(int|string|array $receiver = [], array $fields = [], ?string $name_case = null): stdClass|array|null
{
// Реиницилазиция
$this->robot->api->reinit();
if (is_int($receiver)) {
// Идентификатор
// Инициализация пользователя
$this->robot->api['user_ids'] = $receiver;
} else if (is_array($receiver)) {
// Идентификаторы
// Инициализация пользователей
$this->robot->api['user_ids'] = '';
foreach ($receiver as $key => $user_id) {
// Перебор пользователей для получения информации
// Запись пользователя
$this->robot->api['user_ids'] .= $user_id;
// Запись разделителя
if ($key === array_key_last($receiver)) break;
else $this->robot->api['user_ids'] .= ', ';
}
} else if (is_string($receiver)) {
// Домен
// Инициализация пользователя
$this->robot->api['user_ids'] = $receiver;
}
if (isset($fields)) {
// Запрошены дополнительные запрашиваемые поля
// Инициализация дополнительных запрашиваемых полей
$this->robot->api['fields'] = '';
foreach ($fields as $key => $field) {
// Перебор дополнительных запрашиваемых полей
// Запись запрашиваемого дополнительного поля
$this->robot->api['fields'] .= $field;
// Запись разделителя
if ($key !== array_key_last($fields)) $this->robot->api['fields'] .= ', ';
}
}
// Инициализация падежа
if (isset($name_case)) $this->robot->api['name_case'] = $name_case;
// Запрос
$request = json_decode($this->robot->browser->request('POST', 'users.get', ['form_params' => $this->robot->api->settings])->getBody()->getContents());
// Если в ответе ошибка
if (isset($request->error)) {
throw new Exception('ВКонтакте: ' . $request->error->error_msg, $request->error->error_code);
}
return is_array($receiver) ? $request->response : (isset($request->response[0]) ? $request->response[0] : null);
}
}

View File

@ -4,12 +4,12 @@ declare(strict_types=1);
namespace mirzaev\vk\api;
use mirzaev\vk\robots\robot;
use Throwable;
use Exception;
use ArrayAccess;
use mirzaev\vk\robots\robot;
/**
* Настройки соединения с API
*
@ -17,11 +17,8 @@ use ArrayAccess;
* @var array $settings Настройки
* @var float $version Версия API
*
* @todo
* 1. Создать __isset(), __unset()
*
* @package mirzaev\vk\api
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
class settings implements ArrayAccess
{
@ -30,7 +27,7 @@ class settings implements ArrayAccess
*
* Должна иметь тип string потому, что PHP при стандартных настройках удаляет нули у float
*/
protected const VK_API_VERSION_DEFAULT = '5.130';
protected const VK_API_VERSION_DEFAULT = '5.131';
/**
* Конструктор
@ -79,19 +76,52 @@ class settings implements ArrayAccess
/**
* Реинициализация
*
* @var float $version Версия API (переопределять не рекомендуется)
* @param bool $purge Полная очистка
*/
public function reinit(string $version = null): self
public function reinit(bool $purge = false): self
{
// Буфер
$version = $version ?? $this->settings['v'] ?? null;
// Деинициализация
$this->settings = [];
// Инициализация
// Реинициализация
try {
$this->_init($version);
if ($purge) {
// Полная очистка
// Очистка
$this->settings = [];
} else {
// Инициализация буфера
$buffer = [];
if (isset($this->settings['v'])) {
// Найдена версия API (подразумевается использование робота-группы)
// Запись в буфер
$buffer['v'] = $this->settings['v'];
}
if (isset($this->settings['access_token'])) {
// Найден ключ группы (подразумевается использование робота-группы)
// Запись в буфер
$buffer['access_token'] = $this->settings['access_token'];
}
if (isset($this->settings['group_id'])) {
// Найден идентификатор группы (подразумевается использование робота-группы)
// Запись в буфер
$buffer['group_id'] = $this->settings['group_id'];
}
if (isset($this->settings['user_id'])) {
// Найден идентификатор пользователя (подразумевается использование робота-пользователя)
// Запись в буфер
$buffer['user_id'] = $this->settings['user_id'];
}
// Перенос данных из буфера
$this->settings = $buffer;
}
} catch (Throwable $t) {
throw new Exception('Не удалось инициализировать API', 500, $t->getPrevious());
}
@ -106,45 +136,12 @@ class settings implements ArrayAccess
*/
protected function _init(string $version = self::VK_API_VERSION_DEFAULT): self
{
// Ключ
$this->settings['access_token'] = $this->robot->key;
// Версия API
$this->settings['v'] = $version;
return $this;
}
/**
* Определить и записать получателя
*
* @see mirzaev\vk\api\methods\messages Сообщения
*/
public function destination(string|array|int $target): self
{
if (is_int($target)) {
// Идентификатор
$this->settings['peer_id'] = $target;
return $this;
} else if (is_array($target)) {
// Идентификаторы
$this->settings['user_ids'] = $target;
return $this;
} else if (is_string($target)) {
// Домен
$this->settings['domain'] = $target;
return $this;
}
throw new Exception('Не удалось определить получателя', 500);
}
/**
* Записать свойство
*
@ -176,20 +173,44 @@ class settings implements ArrayAccess
};
}
// public function __unset(string $name): void
// {
// match ($name) {
// 'settings' => throw new Exception('Запрещено удалять настройки', 500),
// 'robot' => throw new Exception('Запрещено удалять робота', 500),
// 'data', 'attachments' => $this->offsetUnset('attachments'),
// default => $this->offsetUnset($name)
// };
// }
/**
* Проверить инициализированность свойства
*
* @param string $name Название
*
* @return bool Свойство инициализировано?
*/
public function __isset(string $name): bool
{
return match ($name) {
'settings' => isset($this->settings),
'robot' => isset($this->robot),
'data', 'attachments' => $this->offsetExists('attachments'),
default => $this->offsetExists($name)
};
}
/**
* Деинициализированность свойство
*
* @param string $name Название
*
* @return void
*/
public function __unset(string $name): void
{
match ($name) {
'settings' => throw new Exception('Запрещено деинициализировать настройки', 500),
'robot' => throw new Exception('Запрещено деинициализировать робота', 500),
'data', 'attachments' => $this->offsetUnset('attachments'),
default => $this->offsetUnset($name)
};
}
/**
* Записать по смещению
*/
public function offsetSet(mixed $offset, mixed $value): mixed
public function offsetSet(mixed $offset, mixed $value): void
{
if (isset($this->settings)) {
if (strcasecmp($offset, 'settings') === 0) {
@ -206,21 +227,27 @@ class settings implements ArrayAccess
if (is_array($value)) {
// Жесткая запись
return $this->settings['attachments'] = $value;
$this->settings['attachments'] = $value;
return;
}
if (empty($this->settings['attachments']) || count($this->settings['attachments']) < 10) {
// Записано менее чем 10 вложений (от 0 до 9)
// Запись (конкатенация)
return $this->settings['attachments'][] = $value;
$this->settings['attachments'][] = $value;
return;
}
throw new Exception('Превышено ограничение на 10 вложений', 500);
} else {
// Запись по ключу или смещению
return $this->settings[$offset] = $value;
$this->settings[$offset] = $value;
return;
}
}
@ -230,7 +257,7 @@ class settings implements ArrayAccess
/**
* Прочитать по смещению
*/
public function &offsetGet(mixed $offset): mixed
public function offsetGet(mixed $offset): mixed
{
if (isset($this->settings)) {
if (strcasecmp($offset, 'settings') === 0) {
@ -254,7 +281,11 @@ class settings implements ArrayAccess
}
/**
* Проверка существования смещения
* Проверить существование смещения
*
* @param mixed $offset Сдвиг
*
* @return bool Смещение существует?
*/
public function offsetExists(mixed $offset): bool
{

View File

@ -8,7 +8,7 @@ use mirzaev\vk\robots\robot;
use mirzaev\vk\traits\singleton;
use mirzaev\vk\loggers\jasmo;
use Exception;
use exception;
/**
* Ядро
@ -24,7 +24,7 @@ use Exception;
* @method public function get($id = null) Чтение из реестра
*
* @package mirzaev\vk
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
final class core
{
@ -32,15 +32,11 @@ final class core
/**
* Счётчик роботов
*
* @var int
*/
private int $robots = 0;
/**
* Реестр роботов
*
* @var array
*/
private array $registry = [];
@ -48,39 +44,32 @@ final class core
* Временная зона
*
* Используется в логировании
*
* @var string
*/
private string $timezone;
private readonly string $timezone;
/**
* Путь до корня проекта
*
* @var string
*/
private string $path_root;
private readonly string $path_root;
/**
* Путь до папки журналов
*
* @var string
*/
private string $path_logs;
private readonly string $path_logs;
/**
* Путь до временной папки
*
* @var string
*/
private string $path_temp;
private readonly string $path_temp;
/**
* Запись в журнал
*
* @param string $file Файл для журналирования
*
* @return self
*
* @todo Добавить установку иного журналиста по спецификации PSR-3
* @todo Более гибкое журналирование
*/
public function journal(string $file = null): self
{
@ -97,6 +86,8 @@ final class core
* @param robot $robot
*
* @see mirzaev\vk\traits\registry Модификация метода
*
* @return void
*/
public function write(int $id, robot $robot): void
{
@ -104,7 +95,7 @@ final class core
// Инициализация уникального идентификатора сессии
$session = count($this->read($id));
} catch (Exception $e) {
} catch (exception $e) {
if ($e->getCode() === 404) {
// Робота или сессии не существует
@ -148,13 +139,13 @@ final class core
return $this->registry[$id][$session];
}
throw new Exception("Сессия $session робота с идентификатором $id не найдена", 404);
throw new exception("Сессия $session робота с идентификатором $id не найдена", 404);
}
return $this->registry[$id];
} else {
throw new Exception("Робот с идентификатором $id не найден", 404);
throw new exception("Робот с идентификатором $id не найден", 404);
}
}
@ -167,6 +158,8 @@ final class core
* @param int|null $id Идентификатор
* @param int|null $session Сессия
*
* @return void
*
* @see mirzaev\vk\traits\registry Модификация метода
*/
public function delete(int|null $id = null, int|null $session = null): void
@ -192,7 +185,7 @@ final class core
return;
}
throw new Exception("Сессия $session робота с идентификатором $id не найдена", 404);
throw new exception("Сессия $session робота с идентификатором $id не найдена", 404);
}
// Вычитание из счётчика количества сессий робота
@ -204,7 +197,7 @@ final class core
return;
}
throw new Exception("Робот с идентификатором $id не найден", 404);
throw new exception("Робот с идентификатором $id не найден", 404);
}
// Полная очистка
@ -214,25 +207,32 @@ final class core
/**
* Записать свойство
*
* @param mixed $name Название
* @param string $name Название
* @param mixed $value Значение
*
* @return void
*/
public function __set(mixed $name, mixed $value): void
public function __set(string $name, mixed $value): void
{
match ($name) {
'timezone' => !isset($this->timezone) ? $this->timezone = $value : throw new Exception('Запрещено переопределять часовой пояс', 500),
'path_root' => !isset($this->path_root) ? $this->path_root = $value : throw new Exception('Запрещено переопределять корневой каталог', 500),
'path_logs' => !isset($this->path_logs) ? $this->path_logs = $value : throw new Exception('Запрещено переопределять каталог журналов', 500),
'path_temp' => !isset($this->path_temp) ? $this->path_temp = $value : throw new Exception('Запрещено переопределять каталог временных файлов', 500)
'timezone' => !isset($this->timezone) ? $this->timezone = $value : throw new exception('Запрещено переопределять часовой пояс', 500),
'path_root' => !isset($this->path_root) ? $this->path_root = $value : throw new exception('Запрещено переопределять корневой каталог', 500),
'path_logs' => !isset($this->path_logs) ? $this->path_logs = $value : throw new exception('Запрещено переопределять каталог журналов', 500),
'path_temp' => !isset($this->path_temp) ? $this->path_temp = $value : throw new exception('Запрещено переопределять каталог временных файлов', 500),
default => throw new exception("Свойство $name не обнаружено", 404)
};
}
/**
* Прочитать свойство
*
* Записывает значение по умолчанию, если свойство не инициализировано
*
* @param mixed $name Название
*
* @return mixed
*/
public function __get(mixed $name): mixed
public function __get(string $name): mixed
{
return match ($name) {
'robots' => $this->robots,
@ -240,7 +240,7 @@ final class core
'path_root' => $this->path_root ?? $this->path_root = dirname(__DIR__),
'path_logs' => $this->path_logs ?? $this->path_logs = $this->__get('path_root') . '/logs',
'path_temp' => $this->path_temp ?? $this->path_temp = $this->__get('path_root') . '/temp',
default => null
default => throw new exception("Свойство \"\$$name\" не обнаружено", 404)
};
}
@ -252,6 +252,8 @@ final class core
*
* @param string $method Метод
* @param array $params Параметры
*
* @return robot
*/
public function __call(string $method, array $params): robot
{
@ -259,7 +261,7 @@ final class core
// Если найден класс реализующий запрошенного робота
return new $robot(...$params);
} else {
throw new Exception("Робот $method не найден", 404);
throw new exception("Робот $method не найден", 404);
}
}
}

View File

@ -21,7 +21,7 @@ use mirzaev\vk\core,
* @see Jasny\ErrorHandler
*
* @package mirzaev\vk\loggers
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
final class jasmo extends logger
{

View File

@ -8,14 +8,12 @@ namespace mirzaev\vk\loggers;
* Абстрактный класс журналиста
*
* @package mirzaev\vk\loggers
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
abstract class logger
{
/**
* Экземпляр класса журналиста
*
* @var logger
*/
public static $logger;

View File

@ -4,23 +4,25 @@ declare(strict_types=1);
namespace mirzaev\vk\robots;
use mirzaev\vk\robots\robot;
use mirzaev\vk\api\longpoll;
use Throwable;
use Exception;
use mirzaev\vk\robots\robot,
mirzaev\vk\api\settings as api,
mirzaev\vk\api\longpoll;
/**
* Робот-группа
*
* @property longpoll $longpoll LongPoll-сессия
*
* @method public function __construct(int|null $id, string|null $key) Конструктор
* @method public function __set($name, $value) Запись свойства
* @method public function __get($name) Чтение свойства
* @method public function __isset($name) Проверка на инициализированность свойства
*
* @package mirzaev\vk\robots
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
final class group extends robot
{
@ -29,6 +31,22 @@ final class group extends robot
*/
protected longpoll $longpoll;
/**
* Конструктор
*
* @param int|null $id Идентификатор
* @param string|null $key Ключ
*/
public function __construct(
protected ?int $id = null,
protected ?string $key = null
) {
parent::__construct($id, $key);
// Инициализация данных API
$this->api['group_id'] = $this->id;
}
/**
* Запись свойства
*

View File

@ -6,16 +6,15 @@ namespace mirzaev\vk\robots;
use Exception;
use GuzzleHttp\Client as browser;
use mirzaev\vk\core;
use mirzaev\vk\proxies\proxy;
use mirzaev\vk\captcha\captcha;
use mirzaev\vk\api\settings as api;
use mirzaev\vk\api\methods\method;
use mirzaev\vk\core,
mirzaev\vk\proxies\proxy,
mirzaev\vk\captcha\captcha,
mirzaev\vk\api\settings as api,
mirzaev\vk\api\methods\method;
use mirzaev\accounts\vk as account;
use GuzzleHttp\Client as browser;
/**
* Робот
@ -26,8 +25,6 @@ use mirzaev\accounts\vk as account;
* @var api $api API ВКонтакте
* @var account $account Аккаунт
* @var browser $browser Браузер
* @var proxy $proxy Прокси
* @var captcha $captcha Обработчик капчи
*
* @var int $messages_mode Режим отправки сообщений
*
@ -42,49 +39,39 @@ use mirzaev\accounts\vk as account;
* @method public function __toString() Конвертация в строку
*
* @package mirzaev\vk\robots
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
abstract class robot
{
/**
* @var int Сессия
* @var int $session Сессия
*/
protected int $session;
protected readonly int $session;
/**
* @var string Аккаунт
* @var account $account Аккаунт ВКонтакте
*/
private account $account;
private readonly account $account;
/**
* @var proxy Прокси
* @var api $api API ВКонтакте
*/
protected proxy $proxy;
protected readonly api $api;
/**
* @var captcha Обработчик капчи
* @var browser $browser Браузер
*/
protected captcha $captcha;
/**
* @var int Режим отправки сообщений
*/
protected int $messages_mode = 1;
/**
* @var api API ВКонтакте
*/
protected api $api;
protected readonly browser $browser;
/**
* Конструктор
*
* @param int|null $id Идентификатор
* @param string|null $key Ключ
* @param int|null $id Идентификатор робота
* @param string|null $key Ключ API ВКонтакте
*/
public function __construct(
protected int|null $id = null,
protected string|null $key = null
protected ?int $id = null,
protected ?string $key = null
) {
// Инициализация ядра
$core = core::init();
@ -97,20 +84,43 @@ abstract class robot
// Идентификация сессии робота
$this->session = count($core->read($this->id));
// Инициализация настроек API
$this->api();
}
/**
* Инициализация ключа
*
* @param string $key Ключ
* @param string|null $key Ключ
*
* @return self
* @return string|self Ключ при чтении или инстанцию робота при записи
*/
public function key(string $key): self
public function key(string|null $key = null): string|self
{
$this->__set('key', $key);
if (isset($key)) {
// Ключ передан (подразумевается как запись)
return $this;
if (isset($this->key)) {
// Ключ уже инициализирован
throw new Exception('Запрещено перезаписывать ключ', 500);
} else {
// Ключ ещё не инициализирован
// Запись ключа
$this->key = $key;
// Инициализация данных в настройках API
$this->api()['access_token'] = $key;
}
return $this;
}
// Ключ не передан (подразумевается как чтение)
return $this->key;
}
/**
@ -118,41 +128,47 @@ abstract class robot
*
* @param account $account Аккаунт
*
* @return self
* @return account|self Аккаунт при чтении или инстанцию робота при записи
*/
public function account(account $account): self
public function account(account|null $account = null): account|self
{
$this->__set('account', $account);
if (isset($account)) {
// Аккаунт передан (подразумевается как запись)
return $this;
if (isset($this->account)) {
// Аккаунт уже инициализирован
throw new Exception('Запрещено перезаписывать аккаунт', 500);
} else {
// Аккаунт ещё не инициализирован
// Запись аккаунта
$this->account = $account;
}
return $this;
}
// Аккаунт не передан (подразумевается как чтение)
return $this->account;
}
/**
* Инициализация прокси
* Инициализация API
*
* @param proxy $proxy Прокси
*
* @return self
* @return api Инстанция настроек API
*/
public function proxy(proxy $proxy): self
public function api(): api
{
$this->__set('proxy', $proxy);
if (!isset($this->api)) {
// Настройки API ещё не инициализированы
return $this;
}
// Запись инстанции настроек API
$this->api = new api($this);
}
/**
* Инициализация обработчика капчи
*
* @param captcha $captcha Обработчик капчи
*
* @return self
*/
public function captcha(captcha $captcha): self
{
$this->__set('captcha', $captcha);
return $this;
return $this->api;
}
/**
@ -166,16 +182,13 @@ abstract class robot
public function __set(string $name, mixed $value): void
{
match ($name) {
'id' => isset($this->id) ? throw new Exception('Запрещено перезаписывать идентификатор', 500) : $this->id = (int) $value,
'session' => isset($this->session) ? throw new Exception('Запрещено перезаписывать сессию', 500) : $this->session = (int) $value,
'key' => isset($this->key) ? throw new Exception('Запрещено перезаписывать ключ', 500) : $this->key = (string) $value,
'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)
'id' => empty($this->id) ?: $this->id = $value,
'session' => empty($this->session) ?: $this->session = $value,
'key' => $this->key((string) $value),
'account' => $this->account($value),
'api' => $this->api(),
'browser' => empty($this->browser) ?: $this->browser = $value,
'messages_new' => $this->messages_new = (int) $value
};
}
@ -191,40 +204,29 @@ abstract class robot
return match ($name) {
'id' => $this->id ?? throw new Exception('Идентификатор не инициализирован', 500),
'session' => $this->session ?? throw new Exception('Сессия не инициализирована', 500),
'key' => $this->key ?? throw new Exception('Ключ не инициализирован', 500),
'api' => $this->api ?? $this->api = new api($this),
'account' => $this->account ?? throw new Exception('Аккаунт не инициализирован', 500),
'key' => $this->key(),
'account' => $this->account(),
'api' => $this->api(),
'browser' => $this->browser ?? $this->browser = new browser([
'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)
};
}
/**
* Проверить свойство на инициализированность
* Проверить на инициализированность
*
* @param string $name Название
*
* @return mixed
* @param mixed $name Название
*/
public function __isset(string $name): bool
{
return match ($name) {
'id' => isset($this->id),
'session' => isset($this->session),
'key' => isset($this->key),
'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)
default => false
};
}
@ -278,4 +280,14 @@ abstract class robot
{
return (string) $this->id;
}
/**
* Клонировать объект
*
* @return void
*/
public function __clone(): void {
// Инициализация робота
$this->__construct($this->id, $this->key);
}
}

View File

@ -12,23 +12,46 @@ use mirzaev\accounts\vk as account;
* Робот-пользователь
*
* @package mirzaev\vk\robots
* @author Arsen Mirzaev Tatyano-Muradovich <red@hood.su>
* @author Arsen Mirzaev Tatyano-Muradovich <arsen@mirzaev.sexy>
*/
final class user extends robot
{
/**
* Конструктор
*
* @param int|null $id Идентификатор
* @param string|null $key Ключ
*/
public function __construct(
protected readonly int|null $id = null,
protected readonly string|null $key = null
) {
parent::__construct($id, $key);
// Инициализация данных API
$this->api['user_id'] = $this->id;
}
/**
* Инициализация аккаунта
*
* @param account $account Аккаунт
*
* @return self
* @return account|self Аккаунт при чтении или инстанцию робота при записи
*/
public function account(account $account): self
public function account(account|null $account = null): account|self
{
parent::account($account);
if (isset($account)) {
// Передан аккаунт
$this->key = $account->key;
if (isset($account->key)) {
// Ключ инициализирован
return $this;
// Инициализация данных в настройках API
$this->api()['access_token'] = $account->key;
}
}
return parent::account($account);
}
}

View File

@ -27,8 +27,6 @@ trait singleton
/**
* Инициализация
*
* @return self
*/
public static function init(): self
{

2
mirzaev/vk/temp/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/*
!.gitignore

View File

@ -1 +0,0 @@
9104

View File

@ -33,6 +33,22 @@ final class groupTest extends TestCase
private static robot $robot;
/**
<<<<<<< HEAD
* @testdox Деинициализация аккаунта
* @afterClass
*/
public static function testAccountDeinit(): void
{
// Инициализация аккаунта
self::$account = new account(empty(self::$id) ? rand(0, 10) : self::$id, __DIR__ . '../../accounts');
// Деаутентификация
self::$account->deauth();
}
/**
=======
>>>>>>> a45b5c327511a74d1fae5ab0e3a1dcc68e7dc3b4
* @testdox Инициализация аккаунта
* @beforeClass
*/
@ -70,6 +86,18 @@ final class groupTest extends TestCase
}
/**
<<<<<<< HEAD
* @testdox Деинициализация робота
* @after
*/
public function testRobotGroupDeinit(): void
{
// Очистка реестра
self::$core->delete();
// Проверка
$this->assertEmpty(self::$core->get(self::$robot->id), 'Ошибка при деинициализации робота');
=======
* @testdox Деинициализация аккаунта
* @afterClass
*/
@ -80,6 +108,7 @@ final class groupTest extends TestCase
// Деаутентификация
self::$account->deauth();
>>>>>>> a45b5c327511a74d1fae5ab0e3a1dcc68e7dc3b4
}
/**
@ -102,6 +131,8 @@ final class groupTest extends TestCase
}
/**
<<<<<<< HEAD
=======
* @testdox Деинициализация робота
* @after
*/
@ -115,6 +146,7 @@ final class groupTest extends TestCase
}
/**
>>>>>>> a45b5c327511a74d1fae5ab0e3a1dcc68e7dc3b4
* @testdox Запись идентификатора
*/
public function testRobotGroupWriteId(): void
@ -226,11 +258,32 @@ final class groupTest extends TestCase
}
/**
<<<<<<< HEAD
* @testdox Запись версии API
*/
public function testRobotGroupWriteVersion(): void
{
// Проверка выброса исключения
$this->expectExceptionMessage('Запрещено перезаписывать версию API');
// Запись версии
self::$robot->version = empty(self::$robot->version) ? rand(0, 10) : self::$robot->version;
}
/**
* @testdox Чтение версии
*/
public function testRobotGroupReadVersion(): void
{
// Проверка
$this->assertNotNull(self::$robot->version, 'Не удалось прочитать версию');
=======
* @testdox Чтение API
*/
public function testRobotGroupReadApi(): void
{
// Проверка
$this->assertNotNull(self::$robot->key(self::$group_key)->api);
>>>>>>> a45b5c327511a74d1fae5ab0e3a1dcc68e7dc3b4
}
}

View File

@ -33,6 +33,22 @@ final class userTest extends TestCase
private static robot $robot;
/**
<<<<<<< HEAD
* @testdox Деинициализация аккаунта
* @afterClass
*/
public static function testAccountDeinit(): void
{
// Инициализация аккаунта
self::$account = new account(empty(self::$id) ? rand(0, 10) : self::$id, __DIR__ . '../../accounts');
// Деаутентификация
self::$account->deauth();
}
/**
=======
>>>>>>> a45b5c327511a74d1fae5ab0e3a1dcc68e7dc3b4
* @testdox Инициализация аккаунта
* @beforeClass
*/
@ -70,6 +86,18 @@ final class userTest extends TestCase
}
/**
<<<<<<< HEAD
* @testdox Деинициализация робота
* @after
*/
public function testRobotGroupDeinit(): void
{
// Очистка реестра
self::$core->delete();
// Проверка
$this->assertEmpty(self::$core->get(self::$robot->id), 'Ошибка при деинициализации робота');
=======
* @testdox Деинициализация аккаунта
* @afterClass
*/
@ -80,6 +108,7 @@ final class userTest extends TestCase
// Деаутентификация
self::$account->deauth();
>>>>>>> a45b5c327511a74d1fae5ab0e3a1dcc68e7dc3b4
}
/**
@ -102,6 +131,8 @@ final class userTest extends TestCase
}
/**
<<<<<<< HEAD
=======
* @testdox Деинициализация робота
* @after
*/
@ -115,6 +146,7 @@ final class userTest extends TestCase
}
/**
>>>>>>> a45b5c327511a74d1fae5ab0e3a1dcc68e7dc3b4
* @testdox Запись идентификатора
*/
public function testRobotGroupWriteId(): void
@ -201,11 +233,57 @@ final class userTest extends TestCase
}
/**
<<<<<<< HEAD
* @testdox Чтение ключа
*/
public function testRobotGroupReadKey(): void
{
// Запись ключа
self::$robot->key((string) (empty(self::$key) ? rand(0, 10) : self::$key));
// Проверки
$this->assertNotNull(self::$robot->key, 'Не удалось записать ключ пользователя');
$this->assertNotNull(self::$robot->key, 'Не удалось прочитать ключ');
}
/**
* @testdox Чтение ключа, если он не инициализирован
*/
public function testRobotGroupReadKeyWhenHeIsNotInit(): void
{
// Проверка выброса исключения
$this->expectExceptionMessage('Ключ не инициализирован');
// Чтение ключа
$key = self::$robot->key;
}
/**
* @testdox Запись версии API
*/
public function testRobotGroupWriteVersion(): void
{
// Проверка выброса исключения
$this->expectExceptionMessage('Запрещено перезаписывать версию API');
// Запись версии
self::$robot->version = empty(self::$robot->version) ? rand(0, 10) : self::$robot->version;
}
/**
* @testdox Чтение версии
*/
public function testRobotGroupReadVersion(): void
{
// Проверка
$this->assertNotNull(self::$robot->version, 'Не удалось прочитать версию');
=======
* @testdox Чтение API
*/
public function testRobotGroupReadApi(): void
{
// Проверка
$this->assertNotNull(self::$robot->key(self::$group_key)->api);
>>>>>>> a45b5c327511a74d1fae5ab0e3a1dcc68e7dc3b4
}
}

View File

@ -1,20 +0,0 @@
<?php
use hood\vk\core;
use hood\vk\api\settings;
require './vendor/autoload.php';
$core = core::init();
$robot = $core->group(12312)->key(1);
$robot = $core->group(12312)->key(1);
$robot = $core->group()->key(1);
$robot = $core->group()->key(1);
$settings = new settings($robot);
$settings['data']['test']['a'] = 2;
$settings['data'] = 2;
var_export($core->read());