diff --git a/src/Events/Handler.php b/src/Events/Handler.php index c9be4f8..501335c 100644 --- a/src/Events/Handler.php +++ b/src/Events/Handler.php @@ -20,7 +20,7 @@ class Handler { const UPDATE_TYPE_WEBHOOK = 1; const UPDATE_TYPE_POLLING = 2; - const UPDATE_TYPE_SOCKET_SERVER = 3; + const UPDATE_TYPE_HTTP_SERVER = 3; public static array $eventHandlers = []; diff --git a/src/TelegramAPI.php b/src/TelegramAPI.php index 5069f59..5b944a2 100644 --- a/src/TelegramAPI.php +++ b/src/TelegramAPI.php @@ -230,7 +230,7 @@ public function hear(int $updateType = Handler::UPDATE_TYPE_WEBHOOK, string $uri exit(); }); break; - case Handler::UPDATE_TYPE_SOCKET_SERVER: + case Handler::UPDATE_TYPE_HTTP_SERVER: $options = getopt('d::', [ 'drop_pending_updates::' ]); diff --git a/src/Utils/Logger/Logger.php b/src/Utils/Logger/Logger.php index 630e549..0bff619 100644 --- a/src/Utils/Logger/Logger.php +++ b/src/Utils/Logger/Logger.php @@ -9,6 +9,7 @@ use Psr\Log\LoggerTrait; use Psr\Log\LogLevel; use Throwable; +use function Amp\ByteStream\getOutputBufferStream; use function Botify\array_some; use function Botify\base_path; use function Botify\config; @@ -93,7 +94,7 @@ public function log($level, $message, array $context = []): void } if ($this->type & static::ECHO_TYPE) { - \Botify\file_put_contents('php://output', Colorize::log($level, $log)); + getOutputBufferStream()->write(Colorize::log($level, $log)); } if ($this->type & static::FILE_TYPE) {