diff --git a/scoreboard_injector/main.py b/scoreboard_injector/main.py index 5634f0e..7d037cf 100644 --- a/scoreboard_injector/main.py +++ b/scoreboard_injector/main.py @@ -174,16 +174,24 @@ async def send_telegram_alert(message: str): """Send alert to telegram bot""" import aiohttp try: + print(f"📱 Sending alert to Telegram: {TELEGRAM_API_URL}") async with aiohttp.ClientSession() as session: async with session.post( TELEGRAM_API_URL, json={"message": message}, headers={"Authorization": f"Bearer {SECRET_TOKEN}"} ) as resp: + response_text = await resp.text() if resp.status != 200: - print(f"Failed to send telegram alert: {await resp.text()}") + print(f"❌ Failed to send telegram alert: Status {resp.status}") + print(f" Response: {response_text}") + else: + print(f"✅ Telegram alert sent successfully") + print(f" Response: {response_text}") except Exception as e: - print(f"Error sending telegram alert: {e}") + print(f"❌ Error sending telegram alert: {e}") + import traceback + traceback.print_exc() async def fetch_task_names(): """Fetch task names from scoreboard API"""