21 lines
754 B
PHP
21 lines
754 B
PHP
<?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"; |