From 7d6c2321652463ce9755f00d98c1a29cd9dc70fd Mon Sep 17 00:00:00 2001 From: "juancarlos.cavero" Date: Tue, 21 Jul 2026 02:20:56 +0200 Subject: [PATCH] =?UTF-8?q?feat(alerts):=20prefijo=20'OPENSHORTS=20?= =?UTF-8?q?=E2=9C=82=EF=B8=8F=20-'=20en=20todos=20los=20mensajes=20de=20Te?= =?UTF-8?q?legram?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El chat de Telegram es compartido con Upload-Post y otros productos, así que cada mensaje de OpenShorts se marca con el nombre para distinguirlos de un vistazo. Aplicado en send_telegram, cubre todas las alertas (pagos, subs, churn, clips). --- cloud/alerts.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cloud/alerts.py b/cloud/alerts.py index e2bc39c..e4f81e9 100644 --- a/cloud/alerts.py +++ b/cloud/alerts.py @@ -48,6 +48,11 @@ def _cooldown_ok(kind: str) -> bool: return True +# Prefix on every OpenShorts Telegram message. The chat is shared with other +# products (Upload-Post, …), so this tags which one each alert is from. +TELEGRAM_PREFIX = "OPENSHORTS ✂️ - " + + async def send_telegram(text: str): """Push a plain-text message to the admin's Telegram chat. No-op if unset. @@ -58,7 +63,8 @@ async def send_telegram(text: str): try: import httpx url = f"https://api.telegram.org/bot{settings.telegram_bot_token}/sendMessage" - payload = {"chat_id": settings.telegram_chat_id, "text": text, + payload = {"chat_id": settings.telegram_chat_id, + "text": TELEGRAM_PREFIX + text, "disable_web_page_preview": True} async with httpx.AsyncClient(timeout=10) as client: await client.post(url, json=payload)