diff --git a/src/Client.php b/src/Client.php index 2350d14..3800675 100644 --- a/src/Client.php +++ b/src/Client.php @@ -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); - $instance->unsetEventHandler(); + if (self::isSessionLoggedIn($instance)) { + $instance->unsetEventHandler(); + } $instance->async(true); $this->instances[$session] = $instance; diff --git a/src/Logger.php b/src/Logger.php index d778779..9e27c4a 100644 --- a/src/Logger.php +++ b/src/Logger.php @@ -162,6 +162,7 @@ class Logger extends AbstractLogger 'file' => $exception->getFile(), 'line' => $exception->getLine(), 'code' => $exception->getCode(), + 'backtrace' => array_slice($exception->getTrace(), 0, 3), ]; } } \ No newline at end of file