Backup automatico script del 2026-07-19 07:00

This commit is contained in:
2026-07-19 07:00:03 +02:00
parent 927f0d4184
commit 4802b021fe
24 changed files with 686 additions and 213 deletions
+18
View File
@@ -192,6 +192,15 @@ def telegram_send_html(message_html: str, chat_ids: Optional[List[str]] = None)
message_html: Messaggio HTML da inviare
chat_ids: Lista di chat IDs (default: TELEGRAM_CHAT_IDS)
"""
try:
from telegram_gate import telegram_alerts_enabled
except ImportError:
telegram_alerts_enabled = lambda: True # type: ignore
if not telegram_alerts_enabled():
LOGGER.info("Telegram sospeso: skip arome_snow")
return False
token = load_bot_token()
if not token:
LOGGER.warning("Telegram token missing: message not sent.")
@@ -252,6 +261,15 @@ def telegram_send_photo(photo_path: str, caption: str, chat_ids: Optional[List[s
Returns:
True se inviata con successo, False altrimenti
"""
try:
from telegram_gate import telegram_alerts_enabled
except ImportError:
telegram_alerts_enabled = lambda: True # type: ignore
if not telegram_alerts_enabled():
LOGGER.info("Telegram sospeso: skip arome_snow photo")
return False
token = load_bot_token()
if not token:
LOGGER.warning("Telegram token missing: photo not sent.")