feat: welcome message, fix per_type save, add missing ciclos flows
- Show welcome_msg (button with "Ver menú") for all new sessions before category menu
- Fix saveConfig() AJAX to include per_type_menu DOM values so they survive individual saves
- Add welcome_menu field to General tab in admin (render + save)
- Add 'atras' command alias (→ show_main_menu)
- Add ciclos_plagas, ciclos_palm, ciclos_tratamientos flows to DB config
- Fix per_type in DB from [] to {} (proper JSON object)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
e9bbf8efce
commit
b288b07ff5
@@ -76,7 +76,14 @@ class NormalBot
|
||||
return self::handleFlow($flows[$currentNode], $context, $company, $ctxId, $menus);
|
||||
}
|
||||
|
||||
// 4. Per-type greeting menu — only for brand-new sessions (currentNode === null)
|
||||
// 4. Welcome message — shown once for brand-new sessions before the category menu
|
||||
$welcomeMenuKey = $config['welcome_menu'] ?? null;
|
||||
if ($welcomeMenuKey && $currentNode === null && isset($menus[$welcomeMenuKey])) {
|
||||
ConversationContext::updateNode($ctxId, '__greeted');
|
||||
return self::buildMenuResponse($menus[$welcomeMenuKey], $context['from'], $company);
|
||||
}
|
||||
|
||||
// 4b. Per-type greeting menu — only for brand-new sessions (currentNode === null)
|
||||
$greetingMenuKey = $perType['greeting_menu'] ?? null;
|
||||
if ($greetingMenuKey !== null && $currentNode === null && isset($menus[$greetingMenuKey])) {
|
||||
ConversationContext::updateNode($ctxId, '__greeted'); // sentinel: evita re-envío del menú
|
||||
|
||||
Reference in New Issue
Block a user