fix(app): fix unhandled exceptions

This commit is contained in:
2025-10-19 15:17:24 +03:00
parent 0386af9e0d
commit aa42643c34
2 changed files with 6 additions and 1 deletions

View File

@@ -48,6 +48,11 @@ class TelegramHandler
public function webhook(Request $request): JsonResponse
{
$update = $request->json();
$message = $update['message'] ?? null;
if (! $message) {
return new JsonResponse([]);
}
$userId = $update['message']['from']['id'];
$chatId = $update['message']['chat']['id'];

View File

@@ -67,7 +67,7 @@ MARKDOWN
$step = $state['data']['step'];
if ($step === 'message_text') {
$message = $update['message']['text'];
$message = Arr::get($update, 'message.text', 'Недопустимый текст сообщения');
$state['data']['data']['message_text'] = $message;
$state['data']['step'] = 'btn_text';
$this->state->setState(self::class, $userId, $chatId, $state['data']);