From 42ecf91720397e8396b6aeee5c0668c247e1aef9 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 16 Jun 2023 14:27:36 +0200 Subject: [PATCH] Improve logic --- src/MTProtoSession/ResponseHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MTProtoSession/ResponseHandler.php b/src/MTProtoSession/ResponseHandler.php index 1dac681573..4e7ef70811 100644 --- a/src/MTProtoSession/ResponseHandler.php +++ b/src/MTProtoSession/ResponseHandler.php @@ -308,7 +308,8 @@ private function handleRpcError(OutgoingMessage $request, array $response): ?cal $this->methodRecall(['message_id' => $request->getMsgId(), 'postpone' => true]); return null; } - if ($response['error_code'] === -503 || \in_array($response['error_message'], ['MSGID_DECREASE_RETRY', 'HISTORY_GET_FAILED', 'RPC_CONNECT_FAILED', 'RPC_CALL_FAIL', 'RPC_MCGET_FAIL', 'PERSISTENT_TIMESTAMP_OUTDATED', 'RPC_MCGET_FAIL', 'no workers running', 'No workers running', '-503'])) { + if ((($response['error_code'] === -503 || $response['error_message'] === '-503') && !\in_array($request->getConstructor(), ['messages.getBotCallbackAnswer', 'messages.getInlineBotResults'], true)) + || (\in_array($response['error_message'], ['MSGID_DECREASE_RETRY', 'HISTORY_GET_FAILED', 'RPC_CONNECT_FAILED', 'RPC_CALL_FAIL', 'RPC_MCGET_FAIL', 'PERSISTENT_TIMESTAMP_OUTDATED', 'RPC_MCGET_FAIL', 'no workers running', 'No workers running']))) { EventLoop::delay(1.0, fn () => $this->methodRecall(['message_id' => $request->getMsgId()])); return null; }