From 4a58b800dc8aee33ec772200f4fbd5baa4e4bcfd Mon Sep 17 00:00:00 2001 From: Lizandro Date: Sat, 18 Jul 2026 19:17:23 +0000 Subject: [PATCH] =?UTF-8?q?feat(telegram):=20quitar=20opci=C3=B3n=20'Habla?= =?UTF-8?q?r=20con=20asesor'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Eliminar botón del menú principal, pago confirmado, pago no confirmado - callback 'agent' redirige al menú principal en vez de transferToAgent - asesor.solicitar del intent también redirige al menú - Limpiar textos 'contacta a un asesor' en mensajes de error Co-Authored-By: Claude Sonnet 4.6 --- app/Services/TelegramBotService.php | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/app/Services/TelegramBotService.php b/app/Services/TelegramBotService.php index 9d2504c..786dd84 100755 --- a/app/Services/TelegramBotService.php +++ b/app/Services/TelegramBotService.php @@ -154,7 +154,7 @@ class TelegramBotService 'creds' => $this->showCredentials($chatId), 'history' => $this->showHistory($chatId), 'profile' => $this->showProfile($chatId), - 'agent' => $this->transferToAgent($chatId), + 'agent' => $this->showMainMenu($chatId), 'pay_apply' => $this->applyPayment($chatId, (int) ($parts[1] ?? 0), $parts[2] ?? null), default => $this->showMainMenu($chatId), }; @@ -171,7 +171,7 @@ class TelegramBotService } if (ChatConfig::get('validacion_foto_habilitada', '0') !== '1') { - $this->send($chatId, "El análisis de comprobantes no está habilitado. Contacta a un asesor."); + $this->send($chatId, "El análisis de comprobantes no está habilitado."); return; } @@ -232,9 +232,8 @@ class TelegramBotService [['text' => '🔙 Menú principal', 'callback_data' => 'menu']], ]; } elseif ($resultado['estado'] === 'ya_usado') { - $texto .= "\nEstado: *⛔ Comprobante ya utilizado*\nEste pago ya fue registrado."; + $texto .= "\nEstado: *⛔ Comprobante ya utilizado*\nEste pago ya fue registrado anteriormente."; $buttons = [ - [['text' => '🧑 Hablar con asesor', 'callback_data' => 'agent']], [['text' => '🔙 Menú principal', 'callback_data' => 'menu']], ]; } else { @@ -243,13 +242,12 @@ class TelegramBotService 'error_imap' => '📧 Error al leer correos IMAP', 'sin_correos' => '📧 Sin correos recientes en bandeja', 'sin_coincidencia' => '📧 Ningún correo coincide con este monto/fecha', - 'error_sistema' => '⚙️ Error interno — un asesor revisará manualmente', - default => '📧 No se pudo verificar', + 'error_sistema' => '⚙️ Error interno, intenta de nuevo en unos minutos', + default => '📧 No se pudo verificar automáticamente', }; - $texto .= "\nEstado: *⚠️ No confirmado*\n_{$motivo}_\n\nUn asesor revisará tu pago."; + $texto .= "\nEstado: *⚠️ No confirmado*\n_{$motivo}_"; $buttons = [ - [['text' => '🧑 Hablar con asesor', 'callback_data' => 'agent']], - [['text' => '🔙 Menú principal', 'callback_data' => 'menu']], + [['text' => '🔙 Menú principal', 'callback_data' => 'menu']], ]; } @@ -620,9 +618,6 @@ class TelegramBotService ['text' => '📋 Historial', 'callback_data' => 'history'], ['text' => '👤 Mi Perfil', 'callback_data' => 'profile'], ], - [ - ['text' => '🧑 Hablar con asesor', 'callback_data' => 'agent'], - ], [ ['text' => '🚪 Cerrar sesión', 'callback_data' => 'logout_ask'], ], @@ -830,7 +825,7 @@ class TelegramBotService $url = $this->createMPPreference($servicio, $valor, $ref); if (! $url) { - $this->send($chatId, "No se pudo generar el link de pago. Intenta de nuevo o contacta a un asesor."); + $this->send($chatId, "No se pudo generar el link de pago. Intenta de nuevo."); return; } @@ -1026,7 +1021,7 @@ class TelegramBotService $url = $this->createMPPreference($promo->nombre ?? 'Promocion streaming', (int) $precio, $ref); if (! $url) { - $this->send($chatId, "No se pudo generar el link de pago. Intenta de nuevo o contacta a un asesor."); + $this->send($chatId, "No se pudo generar el link de pago. Intenta de nuevo."); return; } @@ -1119,7 +1114,7 @@ class TelegramBotService $url = $this->createMPPreference('Recarga de saldo', $monto, $ref); if (! $url) { - $this->send($chatId, "No se pudo generar el link de recarga. Intenta de nuevo o contacta a un asesor."); + $this->send($chatId, "No se pudo generar el link de recarga. Intenta de nuevo."); return; } @@ -1149,7 +1144,7 @@ class TelegramBotService $titular = ChatConfig::get('recarga_banco_titular', ''); if (! $llave) { - $this->send($chatId, "El pago por Bre-B no está disponible. Usa MercadoPago o contacta a un asesor."); + $this->send($chatId, "El pago por Bre-B no está disponible en este momento."); return; } @@ -1326,7 +1321,7 @@ class TelegramBotService 'credenciales.listar' => $this->showCredentials($chatId), 'historial.ver' => $this->showHistory($chatId), 'perfil.ver' => $this->showProfile($chatId), - 'asesor.solicitar' => $this->transferToAgent($chatId), + 'asesor.solicitar' => $this->showMainMenu($chatId), default => $this->showMainMenu($chatId), }; }