diff --git a/api/version/media-url_debug.log b/api/version/media-url_debug.log
index 22b8edb..9df10b8 100644
--- a/api/version/media-url_debug.log
+++ b/api/version/media-url_debug.log
@@ -41,3 +41,6 @@
[2026-01-21 14:36:28] Request: GET /api/version/media-url.php?id=3932473397057815 GET:{"id":"3932473397057815"} POST:[]
[2026-01-21 14:36:28] Graph API request to https://graph.facebook.com/v22.0/3932473397057815
[2026-01-21 14:36:28] Proxying Facebook media URL with Authorization to https://lookaside.fbsbx.com/whatsapp_business/attachments/?mid=3932473397057815&source=getMedia&ext=1769024478&hash=ARnqos_pCP3NfJt-KYcvnkTwjW6kr9XG7VcoVUSjRh6YAQ
+[2026-01-21 14:40:09] Request: GET /api/version/media-url.php?id=3932473397057815 GET:{"id":"3932473397057815"} POST:[]
+[2026-01-21 14:40:09] Graph API request to https://graph.facebook.com/v22.0/3932473397057815
+[2026-01-21 14:40:10] Proxying Facebook media URL with Authorization to https://lookaside.fbsbx.com/whatsapp_business/attachments/?mid=3932473397057815&source=getMedia&ext=1769024699&hash=ARlXiE4qXDbAzqzvCutrIryD_tdYaN1gjuIZWoBHDbilqQ
diff --git a/chat_window.php b/chat_window.php
index 8ec4a2c..e6f6d04 100644
--- a/chat_window.php
+++ b/chat_window.php
@@ -427,6 +427,11 @@ if (empty($user_id)) {
+
+
+
+
+
+
+
+ Usa respuestas automáticas rápidas
+
@@ -555,6 +568,9 @@ if (empty($user_id)) {
// Cargar plantillas
loadTemplates();
+
+ // Cargar respuestas rápidas (quick replies)
+ loadQuickReplies();
} else {
showError('Error cargando datos del usuario');
@@ -985,6 +1001,54 @@ if (empty($user_id)) {
}
}, 5000);
}
+
+ // ===== Quick replies (Respuestas rápidas) =====
+ async function loadQuickReplies() {
+ try {
+ const resp = await whatsappManager.apiCall('get_autoresponses.php');
+ const container = document.getElementById('quickRepliesButtons');
+ const wrapper = document.getElementById('quickRepliesContainer');
+ container.innerHTML = '';
+
+ if (resp && resp.success && Array.isArray(resp.data)) {
+ const responses = resp.data;
+ // Filtrar solo respuestas tipo text y activas
+ responses.forEach(r => {
+ if (r.is_active && (r.response_type === 'text' || !r.response_type)) {
+ const btn = document.createElement('button');
+ btn.type = 'button';
+ btn.className = 'btn btn-sm btn-outline-primary';
+ btn.textContent = r.response_text.length > 40 ? r.response_text.substr(0, 40) + '…' : r.response_text;
+ btn.title = r.response_text;
+ btn.onclick = function() {
+ // enviar la respuesta rápida
+ sendTextMessage(r.response_text);
+ // Registrar en UI
+ showAlert('Respuesta rápida enviada', 'success');
+ };
+ container.appendChild(btn);
+ }
+ });
+
+ // Mostrar contenedor solo si hay respuestas
+ if (container.children.length) {
+ wrapper.style.display = 'block';
+ } else {
+ wrapper.style.display = 'none';
+ }
+ } else {
+ wrapper.style.display = 'none';
+ }
+ } catch (err) {
+ console.error('Error cargando respuestas rápidas:', err);
+ }
+ }
+
+ function toggleQuickReplies() {
+ const wrapper = document.getElementById('quickRepliesContainer');
+ if (!wrapper) return;
+ wrapper.style.display = (wrapper.style.display === 'block') ? 'none' : 'block';
+ }
function showError(message) {
showAlert(message, 'danger');
diff --git a/index.php b/index.php
index e3e3fc9..5dad300 100644
--- a/index.php
+++ b/index.php
@@ -64,6 +64,9 @@ try {
+
+
+