Deploy: 2026-05-22 00:22:23
This commit is contained in:
24
backend/public/debug-chatbot.php
Normal file
24
backend/public/debug-chatbot.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
require_once dirname(__DIR__) . '/app/bootstrap.php';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$rules = \App\Core\Database::select("SELECT * FROM chatbot_rules");
|
||||
foreach ($rules as &$rule) {
|
||||
if (!empty($rule['gemini_api_key'])) {
|
||||
$rule['gemini_api_key_set'] = true;
|
||||
unset($rule['gemini_api_key']);
|
||||
} else {
|
||||
$rule['gemini_api_key_set'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
$logs = \App\Core\Database::select("SELECT * FROM messages_log ORDER BY id DESC LIMIT 20");
|
||||
|
||||
$sessions = \App\Core\Database::select("SELECT * FROM whatsapp_sessions");
|
||||
|
||||
echo json_encode([
|
||||
'chatbot_rules' => $rules,
|
||||
'messages_log' => $logs,
|
||||
'whatsapp_sessions' => $sessions
|
||||
], JSON_PRETTY_PRINT);
|
||||
Reference in New Issue
Block a user