Update BotService.php
This commit is contained in:
@@ -33,16 +33,9 @@ class BotService {
|
|||||||
// ignore logging errors
|
// 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'])) {
|
if ($this->isNewUser($user['id'])) {
|
||||||
// En lugar de welcome textual, mostramos el menú principal y marcamos welcome_sent
|
$this->sendWelcomeMessage($phoneNumber);
|
||||||
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());
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user