<?php
require('include/functions.php');
// Simulate calling sb_dialogflow_message
echo "Calling sb_dialogflow_message test...\n";
// Load Dialogflow functions if not loaded
require_once('apps/dialogflow/functions.php');

$cid = 12345;
$res = sb_dialogflow_message($cid, 'Test Message Log', false, [], 'test-event');
echo "Result: " . json_encode($res) . "\n";

// Check log
echo "Checking log...\n";
$log = file_get_contents('apps/dialogflow/flow_debug.log');
// Get last 200 chars
echo "Last Log Content: " . substr($log, -200) . "\n";
?>
