I'm trying to deploy my Telegram Bot on hosting. The bot was written in python, aiogram. Firstly, for a test I tried to deploy simple echo bot. According to aiogram docs:
WEBHOOK_HOST = 'https://your.domain' # Here I entered my domain
WEBHOOK_PATH = f'/{API_TOKEN}'
WEBHOOK_URL = f"{WEBHOOK_HOST}{WEBHOOK_PATH}"
# webserver settings
WEBAPP_HOST = 'localhost' # THIS IS QUESTION, I do not know what to enter here.
WEBAPP_PORT = 3001
I do not know what to enter to WEBAPP_HOST. I tried enter "localhost", "0.0.0.0", site's domain, and site's ip address, but none of them worked. What should I write there?
It's the FQDN of your webserver where you host the script that you've set up as the webhook.
So if your webhook script is hosted on https://example.com/telegram/webhook.py
, you'll need the following settings:
WEBHOOK_HOST = 'https://example.com'
WEBHOOK_PATH = '/telegram/webhook.py'
WEBHOOK_URL = f"{WEBHOOK_HOST}{WEBHOOK_PATH}"