This commit is contained in:
lizandrogd
2026-01-21 15:34:49 -05:00
parent 4cec2674ef
commit d263cfd225
2 changed files with 39 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
<?php
require_once __DIR__ . '/../config/config.php';
require_once __DIR__ . '/../services/BotService.php';
$db = Database::getInstance();
$phone = '573010000010';
// ensure user
$user = $db->fetch('SELECT * FROM users WHERE phone_number = ?', [$phone]);
if (!$user) {
$id = $db->insert('users', ['phone_number' => $phone, 'status' => 'active', 'created_at' => date('Y-m-d H:i:s')]);
$user = $db->fetch('SELECT * FROM users WHERE id = ?', [$id]);
}
$bot = new BotService();
echo "User id: {$user['id']} phone: {$phone}\n";
// Simulate sending 'INFORMACION ENVIADA' (uppercase + phrase)
echo "--- Sending 'INFORMACION ENVIADA' ---\n";
$bot->processMessage($user, 'INFORMACION ENVIADA', 'text');
// show last conversation entries
$rows = $db->fetchAll('SELECT * FROM conversations WHERE user_id = ? ORDER BY created_at DESC LIMIT 5', [$user['id']]);
print_r($rows);