$fullUrl]); $response = curl_exec($ch); curl_close($ch); $results['set'] = json_decode($response, true); } elseif ($_POST['action'] === 'delete') { $ch = curl_init('https://api.telegram.org/bot' . $token . '/deleteWebhook'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $results['delete'] = json_decode($response, true); } elseif ($_POST['action'] === 'check') { $ch = curl_init('https://api.telegram.org/bot' . $token . '/getWebhookInfo'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $results['info'] = json_decode($response, true); } } // Telegram requiere HTTPS obligatoriamente para webhooks $protocol = 'https'; $host = $_ENV['APP_URL'] ?? getenv('APP_URL') ?? $_SERVER['HTTP_HOST']; // Remover protocolo y trailing slash si existen en APP_URL $host = preg_replace('/^https?:\/\//', '', $host); $host = rtrim($host, '/'); $currentUrl = $protocol . '://' . $host . '/telegram/webhook/telegram_bot_webhook.php'; require_once __DIR__ . '/templates/header.php'; ?>

Configurar Webhook de Telegram

Importante: Telegram requiere obligatoriamente HTTPS con un certificado SSL válido. Asegúrate de que tu dominio tenga SSL activado. La URL propuesta usa:
Webhook configurado correctamente!
Error:
Webhook eliminado correctamente
Error:
Estado Actual del Webhook

URL:

Activo:

Errores:

No hay webhook configurado

URL del Webhook

URL base para el webhook (se añadirá automáticamente el token de autenticación):

Configurar Webhook
Opciones