Update BotService.php

This commit is contained in:
lizandrogd
2026-01-21 15:22:30 -05:00
parent b709d65190
commit b740b9684c
+2 -9
View File
@@ -33,16 +33,9 @@ class BotService {
// ignore logging errors
}
// Verificar si es un nuevo usuario (iniciar con menú principal)
// Verificar si es un nuevo usuario (enviar mensaje de bienvenida)
if ($this->isNewUser($user['id'])) {
// En lugar de welcome textual, mostramos el menú principal y marcamos welcome_sent
try {
$this->showMainMenu($phoneNumber);
$this->db->update('users', ['welcome_sent_at' => date('Y-m-d H:i:s')], 'phone_number = :phone', ['phone' => $phoneNumber]);
error_log("[BotService] processMessage - initial menu sent to new user {$user['id']}");
} catch (Exception $e) {
error_log('[BotService] Failed to send initial menu: ' . $e->getMessage());
}
$this->sendWelcomeMessage($phoneNumber);
return;
}