From 06c99ec835e278a42f120e18ee6704806a8db5f8 Mon Sep 17 00:00:00 2001 From: JJ Date: Fri, 24 Jan 2025 12:37:14 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adimos=20soporte=20para=20html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notificacion_telegram.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/notificacion_telegram.py b/notificacion_telegram.py index c1a8c5c..981ca09 100644 --- a/notificacion_telegram.py +++ b/notificacion_telegram.py @@ -22,8 +22,13 @@ async def enviar_mensaje(mensaje): # Crear una instancia del bot bot = Bot(token=TOKEN) - # Enviar el mensaje al grupo - await bot.send_message(chat_id=GRUPO_ALERTAS_ID, text=mensaje) + # Enviar el mensaje al grupo con formato HTML + await bot.send_message( + chat_id=GRUPO_ALERTAS_ID, + text=mensaje, + parse_mode="HTML" # Indicar que el mensaje usa formato HTML + ) + logger.info(f"Mensaje enviado al grupo de guardias: {mensaje}") except Exception as e: logger.error(f"Error al enviar el mensaje: {e}")