UP
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user