<?php
require_once __DIR__ . '/config.php';

$botUrl = 'https://' . $_SERVER['HTTP_HOST'] . str_replace('set_webhook.php', 'bot.php', $_SERVER['REQUEST_URI']);
$apiUrl = BOT_API . '/setWebhook?url=' . urlencode($botUrl);

$response = @file_get_contents($apiUrl);

echo "<h1>Webhook Setup</h1>";
echo "<p>Bot URL: <b>" . htmlspecialchars($botUrl) . "</b></p>";
echo "<p>Telegram Response: " . htmlspecialchars($response) . "</p>";
