Spaces:
Sleeping
Sleeping
Update set_webhook.html
Browse files25 unmodified lines262728293031323334353637383940414243444546474849505152535425 unmodified linesfunction activateWebhook() {const token = document.getElementById("token").value;const url = document.getElementById("url").value;if (!token || !url) {document.getElementById("result").innerText = "Введите все данные!";return;}// Отправляем запрос на наш сервер для активации маршрутаfetch('/set-webhook', {method: 'POST',headers: { 'Content-Type': 'application/json' },body: JSON.stringify({token: token,url: url})}).then(response => response.json()).then(result => {document.getElementById("result").innerText = "Webhook активирован успешно!";}).catch(error => {document.getElementById("result").innerText = "Ошибка: " + error;});}</script></body></html>25 unmodified lines262728293031323334353637383940414243444546474849505152535455565725 unmodified linesfunction activateWebhook() {const token = document.getElementById("token").value;const url = document.getElementById("url").value;if (!token || !url) {document.getElementById("result").innerText = "Введите все данные!";return;}// Отправляем запрос на Telegram API для установки webhookconst apiUrl = `https://api.telegram.org/bot${token}/setWebhook`;fetch(apiUrl, {method: 'POST',headers: { 'Content-Type': 'application/json' },body: JSON.stringify({ url: url })}).then(response => response.json()).then(result => {if (result.ok) {document.getElementById("result").innerText = "Webhook активирован успешно!";} else {document.getElementById("result").innerText = `Ошибка: ${result.description}`;}}).catch(error => {document.getElementById("result").innerText = "Ошибка: " + error.message;});}</script></body></html>
set_webhook.html+12-9