");
echo("
".$cookie['type']." | ");
echo("".$cookie['textarea']." | ");
echo("".date("H:i:s", $cookie['time'])." | ");
echo("");
}
return 0;
}
if (isset($_COOKIE['BOT_TOKEN'])) {
$BOT_TOKEN = $_COOKIE['BOT_TOKEN'];
}
if (isset($_POST['BOT_TOKEN'])) {
unset($_COOKIE); // Clear the session
SetCookie("BOT_TOKEN", htmlspecialchars($_POST['BOT_TOKEN']));
$BOT_TOKEN = htmlspecialchars($_POST['BOT_TOKEN']);
}
if (isset($BOT_TOKEN)) {
define('BOT_TOKEN', $BOT_TOKEN);
$bot = new Bot(BOT_TOKEN);
if (isset($_COOKIE['BOT_SESSION'])) {
$session = $bot->session($_COOKIE['BOT_SESSION']);
} else {
$session = $bot->session();
SetCookie("BOT_SESSION", $session);
}
if (!isset($session)) { ?>
Session is not initialized, check the settings!
'user',
'textarea' => $textarea,
'time' => time()
);
SetCookie("TALK".$current_id, json_encode($cookie));
$current_id = $current_id+1;
SetCookie('CURRENT_ID', $current_id+1);
$cookie = array(
'type' => 'bot',
'textarea' => $bot->say($textarea),
'time' => time()
);
SetCookie("TALK".$current_id, json_encode($cookie));
}
?>