update API links
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2025-09-29 23:49:47 +03:00
parent 6e3a2fbdf7
commit ae3fd8652d
4 changed files with 24 additions and 9 deletions
+3 -5
View File
@@ -28,12 +28,10 @@ def send_message(user_id, message_text, bot_url=None, api_token=None):
webhook_port = os.getenv('WEBHOOK_PORT', '5005')
if webhook_url:
# Извлекаем хост из WEBHOOK_URL
from urllib.parse import urlparse
parsed = urlparse(webhook_url)
bot_url = f"http://{parsed.hostname}:{webhook_port}"
# Используем внешний URL через reverse proxy
bot_url = f"{webhook_url}/send_message"
else:
bot_url = f"http://localhost:{webhook_port}"
bot_url = f"http://localhost:{webhook_port}/send_message"
if api_token is None:
api_token = os.getenv('WEBHOOK_SECRET')