[{"id":2898,"intent_key":"menu","label":"Menú de comandos","description":"Lista todos los intents activos disponibles para el bot.","question_examples":"menu\nayuda\ncomandos\nque puedes hacer\nlista de comandos","sql_query":"SELECT CONCAT(\"\/\", intent_key) AS comando, label AS descripcion FROM dashboard_alerting_bot_intents WHERE is_active = 1 ORDER BY sort_order ASC, id ASC","response_template":"*{{title}}*\n\nComandos disponibles:\n```\n{{rows_table}}\n```\nTip: escribe \/13Go seguido del comando o frase de ejemplo.","is_active":1,"sort_order":0,"created_at":"2026-03-29 21:53:19","updated_at":"2026-03-29 21:53:29"},{"id":1,"intent_key":"sus7d","label":"Suscripciones últimos 7 días","description":"Devuelve las suscripciones por día para los últimos 7 días.","question_examples":"suscripciones 7 dias\nsubs 7d\nsus7d\nsuscripciones por dia\ncuantas suscripciones\nreporte subs\nsubs_7d_daily","sql_query":"SELECT DATE(window_start) AS fecha, SUM(COALESCE(nuevos_suscriptores,0)) AS total\nFROM flow_suscriptores_por_hora \nWHERE window_start >= DATE_SUB(CURDATE(), INTERVAL 6 DAY) \n  AND window_start < DATE_ADD(CURDATE(), INTERVAL 1 DAY)\nGROUP BY DATE(window_start)\nORDER BY fecha DESC","response_template":"*{{title}}*\n```\n{{rows_table}}\n```","is_active":1,"sort_order":10,"created_at":"2026-03-28 19:02:47","updated_at":"2026-03-29 23:39:40"},{"id":2915,"intent_key":"subs_7d_daily","label":"Suscripciones últimos 7 días","description":"Devuelve las suscripciones por día para los últimos 7 días.","question_examples":"suscripciones 7 dias\nsubs 7d\nsuscripciones por dia","sql_query":"SELECT DATE(window_start) AS fecha, SUM(COALESCE(nuevos_suscriptores,0)) AS total FROM flow_suscriptores_por_hora WHERE window_start >= DATE_SUB(CURDATE(), INTERVAL 6 DAY) AND window_start < DATE_ADD(CURDATE(), INTERVAL 1 DAY) GROUP BY DATE(window_start) ORDER BY DATE(window_start) ASC","response_template":"*{{title}}*\\n{{rows_table}}","is_active":1,"sort_order":10,"created_at":"2026-04-01 13:24:19","updated_at":"2026-04-01 13:24:19"},{"id":2897,"intent_key":"sus24h","label":"Suscripciones altas y bajas por hora (24h)","description":"Entrega altas y bajas por hora de las ultimas 24 horas, con neto por hora.","question_examples":"suscripciones 24h\naltas y bajas 24h\nsuscripciones por hora\naltas por hora\nbajas por hora\nreporte suscripciones 24h\nsuscripciones_24h_hora","sql_query":"SELECT DATE_FORMAT(t.hour_slot, \"%Y-%m-%d %H:00\") AS hora, t.altas, t.bajas, (t.altas - t.bajas) AS neto FROM ( SELECT h.hour_slot, COALESCE(a.altas,0) AS altas, COALESCE(b.bajas,0) AS bajas FROM ( SELECT window_start AS hour_slot FROM flow_suscriptores_por_hora WHERE window_start >= DATE_SUB(NOW(), INTERVAL 24 HOUR) UNION SELECT window_start AS hour_slot FROM flow_bajas_por_hora WHERE window_start >= DATE_SUB(NOW(), INTERVAL 24 HOUR) ) h LEFT JOIN ( SELECT window_start, SUM(COALESCE(nuevos_suscriptores,0)) AS altas FROM flow_suscriptores_por_hora WHERE window_start >= DATE_SUB(NOW(), INTERVAL 24 HOUR) GROUP BY window_start ) a ON a.window_start = h.hour_slot LEFT JOIN ( SELECT window_start, SUM(COALESCE(bajas,0)) AS bajas FROM flow_bajas_por_hora WHERE window_start >= DATE_SUB(NOW(), INTERVAL 24 HOUR) GROUP BY window_start ) b ON b.window_start = h.hour_slot ) t ORDER BY t.hour_slot DESC","response_template":"*{{title}}*\n\nUltimas 24 horas (Chile):\n```\n{{rows_table}}\n```","is_active":1,"sort_order":15,"created_at":"2026-03-29 21:18:15","updated_at":"2026-03-29 23:35:46"},{"id":2,"intent_key":"yt_videos_7d_daily","label":"Videos YouTube últimos 7 días","description":"Configura sql_query con tu tabla real de videos para habilitar esta consulta.","question_examples":"videos 7 dias\nyoutube 7 dias\nvideos youtube por dia","sql_query":"","response_template":"*{{title}}*\\n{{rows_table}}","is_active":0,"sort_order":20,"created_at":"2026-03-28 19:02:47","updated_at":"2026-03-28 19:02:47"},{"id":2911,"intent_key":"yt7d","label":"YouTube videos por día (7d)","description":"Cantidad de videos subidos por dia en YouTube durante los ultimos 7 dias.","question_examples":"yt7d\nyoutube 7 dias\nvideos youtube por dia\nvideos subidos por dia","sql_query":"SELECT DATE(published_at) AS fecha, COUNT(*) AS total FROM youtube_uploads WHERE published_at >= DATE_SUB(CURDATE(), INTERVAL 6 DAY) AND published_at < DATE_ADD(CURDATE(), INTERVAL 1 DAY) GROUP BY DATE(published_at) ORDER BY DATE(published_at) ASC","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":20,"created_at":"2026-03-30 18:45:46","updated_at":"2026-03-30 18:45:46"},{"id":2912,"intent_key":"yt_top_plays_7d","label":"Top videos por plays (7d)","description":"Ranking de videos con mayor cantidad de reproducciones en los ultimos 7 dias.","question_examples":"yt_top_plays_7d\ntop videos 7d\nyoutube top plays","sql_query":"SELECT m.video_key, COALESCE(MAX(v.titulo), MAX(m.titulo)) AS titulo, SUM(m.plays) AS plays_7d, SUM(m.streams) AS streams_7d FROM c13_metricas_videos m LEFT JOIN c13_videos v ON v.`key` = m.video_key WHERE m.fecha >= DATE_SUB(CURDATE(), INTERVAL 6 DAY) AND m.fecha < DATE_ADD(CURDATE(), INTERVAL 1 DAY) GROUP BY m.video_key ORDER BY plays_7d DESC LIMIT 10","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":21,"created_at":"2026-03-30 18:53:24","updated_at":"2026-03-30 18:53:24"},{"id":2913,"intent_key":"yt_subs_growth_7d","label":"YouTube crecimiento suscriptores (7d)","description":"Variacion diaria de suscriptores en YouTube para los ultimos 7 dias.","question_examples":"yt_subs_growth_7d\ncrecimiento suscriptores youtube\nyoutube subs 7d","sql_query":"WITH daily AS (SELECT DATE(collected_at_utc) AS fecha, MAX(collected_at_utc) AS max_ts FROM youtube_channel_metrics GROUP BY DATE(collected_at_utc)), snap AS (SELECT DATE(m.collected_at_utc) AS fecha, m.subscriber_count FROM youtube_channel_metrics m JOIN daily d ON d.max_ts = m.collected_at_utc) SELECT s1.fecha, (s1.subscriber_count - COALESCE(s0.subscriber_count, s1.subscriber_count)) AS total FROM snap s1 LEFT JOIN snap s0 ON s0.fecha = DATE_SUB(s1.fecha, INTERVAL 1 DAY) WHERE s1.fecha >= DATE_SUB(CURDATE(), INTERVAL 6 DAY) AND s1.fecha < DATE_ADD(CURDATE(), INTERVAL 1 DAY) ORDER BY s1.fecha ASC","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":22,"created_at":"2026-03-30 18:53:24","updated_at":"2026-03-30 18:53:24"},{"id":2914,"intent_key":"c13_plays_7d","label":"C13 plays diarios (7d)","description":"Evolucion diaria de reproducciones en C13 durante los ultimos 7 dias.","question_examples":"c13_plays_7d\nplays diarios 7d\nc13 plays 7 dias","sql_query":"SELECT fecha, SUM(plays) AS total FROM c13_metricas_videos WHERE fecha >= DATE_SUB(CURDATE(), INTERVAL 6 DAY) AND fecha < DATE_ADD(CURDATE(), INTERVAL 1 DAY) GROUP BY fecha ORDER BY fecha ASC","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":23,"created_at":"2026-03-30 18:53:24","updated_at":"2026-03-30 18:53:24"},{"id":2901,"intent_key":"ventas_hoy","label":"Ventas hoy (resumen)","description":"Transacciones, bruto, fee, impuestos y neto del dia actual.","question_examples":"ventas hoy\nresumen ventas hoy\ningresos hoy\nneto hoy","sql_query":"SELECT sale_date AS fecha, total_transacciones, total_bruto, total_fee, total_impuestos, total_neto FROM flow_ventas WHERE sale_date = CURDATE()","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":30,"created_at":"2026-03-29 23:52:38","updated_at":"2026-03-29 23:52:38"},{"id":2902,"intent_key":"ventas_neto_7d","label":"Ventas netas ultimos 7 dias","description":"Neto y transacciones por dia para los ultimos 7 dias.","question_examples":"ventas 7 dias\nneto 7 dias\nventas semanales\nreporte neto semanal","sql_query":"SELECT sale_date AS fecha, total_transacciones, total_neto FROM flow_ventas WHERE sale_date >= DATE_SUB(CURDATE(), INTERVAL 6 DAY) ORDER BY sale_date DESC","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":31,"created_at":"2026-03-29 23:52:38","updated_at":"2026-03-29 23:52:38"},{"id":2903,"intent_key":"prepago_hoy","label":"Prepago hoy (resumen)","description":"Resumen diario de ventas prepago.","question_examples":"prepago hoy\nventas prepago hoy\nneto prepago hoy","sql_query":"SELECT sale_date AS fecha, total_transacciones, total_bruto, total_neto FROM flow_ventas_prepago WHERE sale_date = CURDATE()","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":32,"created_at":"2026-03-29 23:52:38","updated_at":"2026-03-29 23:52:38"},{"id":2904,"intent_key":"prepago_mix_7d","label":"Prepago por monto (7d)","description":"Mix de cantidades prepago por rango de monto en los ultimos 7 dias.","question_examples":"mix prepago\nprepago por monto\nprepago 7 dias","sql_query":"SELECT sale_date AS fecha, q_2990, q_5990, q_9990, q_otros FROM flow_ventas_prepago_por_monto WHERE sale_date >= DATE_SUB(CURDATE(), INTERVAL 6 DAY) ORDER BY sale_date DESC","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":33,"created_at":"2026-03-29 23:52:38","updated_at":"2026-03-29 23:52:38"},{"id":2905,"intent_key":"top_productos_hoy","label":"Top productos hoy","description":"Top 10 productos por transacciones del dia actual.","question_examples":"top productos hoy\nproductos vendidos hoy\nranking productos hoy","sql_query":"SELECT item_name, SUM(tx_count) AS transacciones, ROUND(SUM(net_amount),2) AS neto FROM flow_ventas_intervalo_detalle WHERE sale_date = CURDATE() GROUP BY item_name ORDER BY transacciones DESC LIMIT 10","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":34,"created_at":"2026-03-29 23:52:38","updated_at":"2026-03-29 23:52:38"},{"id":2906,"intent_key":"top_productos_7d","label":"Top productos ultimos 7 dias","description":"Top 10 productos por neto en los ultimos 7 dias.","question_examples":"top productos 7 dias\nranking semanal productos\nproductos mas vendidos semana","sql_query":"SELECT item_name, SUM(tx_count) AS transacciones, ROUND(SUM(net_amount),2) AS neto FROM flow_ventas_intervalo_detalle WHERE sale_date >= DATE_SUB(CURDATE(), INTERVAL 6 DAY) GROUP BY item_name ORDER BY neto DESC LIMIT 10","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":35,"created_at":"2026-03-29 23:52:38","updated_at":"2026-03-29 23:52:38"},{"id":2907,"intent_key":"suscripciones_activas_plan","label":"Suscripciones activas por plan","description":"Foto actual de suscripciones activas por plan.","question_examples":"suscripciones activas\nactivos por plan\nplanes activos","sql_query":"SELECT plan_nombre, activos FROM flow_suscripciones WHERE snapshot_date = (SELECT MAX(snapshot_date) FROM flow_suscripciones) ORDER BY activos DESC","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":36,"created_at":"2026-03-29 23:52:38","updated_at":"2026-03-29 23:52:38"},{"id":2908,"intent_key":"bajas_hoy_plan","label":"Bajas hoy por plan","description":"Total de bajas del dia actual agrupadas por plan.","question_examples":"bajas hoy\nbajas por plan hoy\ncancelaciones hoy","sql_query":"SELECT plan_nombre, SUM(bajas) AS bajas FROM flow_bajas_por_hora WHERE DATE(window_start)=CURDATE() GROUP BY plan_nombre ORDER BY bajas DESC","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":37,"created_at":"2026-03-29 23:52:38","updated_at":"2026-03-29 23:52:38"},{"id":2909,"intent_key":"prevent_cancel_hoy","label":"Prevent cancel hoy","description":"Redemptions del dia actual en prevent cancel.","question_examples":"prevent cancel hoy\nredemptions hoy\ncupones hoy","sql_query":"SELECT snapshot_date AS fecha, SUM(redemptions) AS redemptions FROM flow_prevent_cancel WHERE snapshot_date = CURDATE() GROUP BY snapshot_date","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":38,"created_at":"2026-03-29 23:52:38","updated_at":"2026-03-29 23:52:38"},{"id":2910,"intent_key":"prevent_cancel_7d","label":"Prevent cancel ultimos 7 dias","description":"Serie diaria de redemptions prevent cancel en ultimos 7 dias.","question_examples":"prevent cancel 7 dias\nredemptions 7 dias\ncupones semana","sql_query":"SELECT snapshot_date AS fecha, redemptions_daily FROM flow_prevent_cancel_daily WHERE snapshot_date >= DATE_SUB(CURDATE(), INTERVAL 6 DAY) ORDER BY snapshot_date DESC","response_template":"*{{title}}*\n{{rows_table}}","is_active":1,"sort_order":39,"created_at":"2026-03-29 23:52:38","updated_at":"2026-03-29 23:52:38"}]