fix: reset nodo tras saludo + fallback por categoria 3

This commit is contained in:
Lizandro Guarnizo
2026-06-27 18:51:30 -05:00
parent b96dbcc394
commit 02108b7ffa
2 changed files with 8 additions and 3 deletions
+4
View File
@@ -97,6 +97,10 @@ $menuConfig = [
'ciclo_cosecha_historico' => ['type' => 'function', 'function' => 'api_report', 'params' => ['endpoint_key' => 'cosecha_dn', 'filename' => 'ciclo_cosecha_30dias.xlsx', 'caption' => 'Histórico ciclos de cosecha últimos 30 días', 'date_mode' => 'last_30']],
],
'per_type' => [
'3' => [
'greeting' => '¡Bienvenido! Escribe *menu* para ver las opciones disponibles.',
'fallback' => 'No entendí. Escribe *menu* para ver las opciones disponibles.',
],
'1' => [
'greeting' => '¡Bienvenido! Escribe *menu* para recibir información.',
'fallback' => 'Escribe *menu* para recibir información.',
+4 -3
View File
@@ -48,14 +48,15 @@ class NormalBot
$greeting = $perType['greeting'] ?? $config['greeting'] ?? null;
if ($greeting !== null && $currentNode === null) {
ConversationContext::updateNode($ctxId, 'greeting');
$greetingFlowId = $perType['greeting_flow'] ?? 'greeting';
if (isset($flows[$greetingFlowId])) {
ConversationContext::updateNode($ctxId, $greetingFlowId);
return self::handleFlow($flows[$greetingFlowId], $context, $company, $ctxId);
}
return self::sendText($greeting, $context['from'], $company);
$response = self::sendText($greeting, $context['from'], $company);
ConversationContext::updateNode($ctxId, null);
return $response;
}
$fallback = $perType['fallback'] ?? $config['fallback'] ?? null;