Commit Graph
6 Commits
Author SHA1 Message Date
Lizandro GuarnizoandClaude Sonnet 4.6 6f799c3829 feat: media via AI, text via NormalBot only, ai_for_media toggle
- Text/interactive/button messages → NormalBot only, never escalates to AI
- Image/audio/video/document → AiBot.processMedia() if ai_for_media enabled,
  else falls back to category greeting menu
- AiBot.processMedia() uses permission_type context so AI acknowledges uploads
  for perm 3 and redirects others to their menu
- WpWebhook.handleMedia now calls BotRouter so the bot responds to media
- Admin UI: checkbox toggle "Procesar imágenes y archivos con IA" in AI tab
- categoryMenuFallback() extracted in BotRouter as shared helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 13:28:56 -05:00
Lizandro GuarnizoandClaude Sonnet 4.6 b6a85c33f7 fix: salir button works, cap at 3 buttons, no AI error on unmatched input
- Add 'goodbye' function: resets context + sends farewell with menu hint
- Add safety slice to 3 buttons in buildMenuResponse (WhatsApp hard limit)
- In hybrid mode: when greeting_menu is configured for the user's category,
  use it as fallback instead of escalating to AI — prevents "Lo siento,
  tengo problemas..." from appearing when nothing matches
- Expose buildGreetingMenu() as public for BotRouter access
- DB: fixed submenu_informes and submenu_ciclos from 4→3 buttons,
  added salir flow (goodbye function) and salir/exit commands (company 2)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 13:10:08 -05:00
Lizandro Guarnizo 7407c716d4 fix: usar phone_number_id real del webhook + actualizado en BD 2026-06-27 18:25:03 -05:00
Lizandro Guarnizo c053ba3295 fix: enviar respuestas del bot directamente por WhatsApp sin depender de cola 2026-06-27 18:12:50 -05:00
Lizandro Guarnizo 51c187e47d feat: menu navegable con submenus y descarga de reportes via api_report
- NormalBot: nueva funcion api_report para descargar PDF/Excel del ERP y enviarlo por WhatsApp
- NormalBot: resolveMenu() para referenciar menus por nombre en los flujos
- WhatsAppSender: uploadMedia() y sendDocument() para envio de documentos
- BotRouter: guarda respuestas en conversations para visibilidad en el chat
- Script apply-menus.php con estructura completa de menus y endpoints
2026-06-27 11:30:08 -05:00
Lizandro Guarnizo bc422e0a1c cambios importantes 2026-06-12 12:18:21 -05:00