This commit is contained in:
Lizandro Guarnizo
2026-01-21 22:11:12 -05:00
parent 2b92e47624
commit 31dbc8aa86
9 changed files with 158 additions and 4 deletions
+21
View File
@@ -0,0 +1,21 @@
<?php
require_once __DIR__ . '/../config/config.php';
require_once __DIR__ . '/../services/BotService.php';
$db = Database::getInstance();
$user = $db->fetch('SELECT id, phone_number FROM users LIMIT 1');
if (!$user) {
echo "No users found\n";
exit(1);
}
// Mark user as in_service
$db->update('users', ['in_service' => 1, 'in_service_by' => 1, 'in_service_at' => date('Y-m-d H:i:s')], 'id = :id', ['id' => $user['id']]);
// Fetch stale user array (simulate that caller has an old copy without in_service)
$staleUser = ['id' => $user['id'], 'phone_number' => $user['phone_number']];
$bot = new BotService();
$bot->processMessage($staleUser, 'hola', 'text');
echo "processMessage invoked (should have skipped bot processing if in_service)\n";