unsetEvent handler fix

This commit is contained in:
Alexander Pankratov 2020-05-12 19:00:54 +03:00
parent bbe182901d
commit 32cb13b6a8
2 changed files with 4 additions and 1 deletions

View File

@ -60,7 +60,9 @@ class Client
Files::checkOrCreateSessionFolder($file);
$settings = array_replace_recursive((array) Config::getInstance()->get('telegram'), $settings);
$instance = new MadelineProto\API($file, $settings);
if (self::isSessionLoggedIn($instance)) {
$instance->unsetEventHandler();
}
$instance->async(true);
$this->instances[$session] = $instance;

View File

@ -162,6 +162,7 @@ class Logger extends AbstractLogger
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'code' => $exception->getCode(),
'backtrace' => array_slice($exception->getTrace(), 0, 3),
];
}
}