From 757164da3effae7e64ccbbc3764ae7e69f80a622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Tshipenchko?= Date: Mon, 2 Jan 2023 19:42:03 +0600 Subject: [PATCH] Added briefly explanation how the Webhook works --- examples/webhook.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/webhook.py b/examples/webhook.py index 6fbe7024..baa9a26d 100644 --- a/examples/webhook.py +++ b/examples/webhook.py @@ -11,11 +11,16 @@ from aiogram.methods import SendMessage TELEGRAM_TOKEN = getenv("TELEGRAM_TOKEN") +# Webhook is a way to receive updates from Telegram servers +# Telegram sends POST request to the WEBHOOK_URL with JSON body. +# It means that requests to WEBHOOK_URL must be handled by webserver. # Webhook settings WEBHOOK_HOST = getenv("WEBHOOK_HOST", "https://your.domain") WEBHOOK_PATH = getenv("WEBHOOK_PATH", "/path/to/api") WEBHOOK_URL = f"{WEBHOOK_HOST}{WEBHOOK_PATH}" +# You have to guarantee that requests to WEBHOOK_URL are handled by aiohttp webserver. +# More information about Webhook: https://core.telegram.org/bots/webhooks # Webserver settings WEBAPP_HOST = getenv("WEBAPP_HOST", "localhost") # or ip WEBAPP_PORT = getenv("WEBAPP_PORT", 3001)