"""
Corré este script UNA VEZ, después de subir el bot a tu hosting,
para decirle a Telegram a qué URL mandar los mensajes.

Uso:
    python configurar_webhook.py https://tudominio.com/webhook
"""
import sys
import telegram_client as tg
from config import TELEGRAM_WEBHOOK_SECRET

if len(sys.argv) < 2:
    print("Uso: python configurar_webhook.py https://tudominio.com/webhook")
    sys.exit(1)

url = sys.argv[1]
resultado = tg.set_webhook(url, secret_token=TELEGRAM_WEBHOOK_SECRET or None)
print(resultado)
