<?php
// ফাইল: set_webhook.php
require_once 'config.php';

$webhook_url = 'https://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/bot.php';
$api_url = 'https://api.telegram.org/bot' . BOT_TOKEN . '/setWebhook?url=' . $webhook_url;

$response = file_get_contents($api_url);

echo "<h1>Webhook Setup Result</h1>";
echo "<p><strong>Webhook URL:</strong> {$webhook_url}</p>";
echo "<p><strong>Telegram API Response:</strong></p>";
echo "<pre>" . htmlspecialchars($response) . "</pre>";
?>