fix: reset nodo tras saludo + fallback por categoria 3
This commit is contained in:
@@ -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.',
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user