Backup automatico script del 2026-07-19 07:00
This commit is contained in:
@@ -176,6 +176,18 @@ def telegram_send_html(message_html: str, chat_ids: Optional[List[str]] = None)
|
||||
if message_html:
|
||||
message_html = re.sub(r"<\s*br\s*/?\s*>", "\n", message_html, flags=re.IGNORECASE)
|
||||
|
||||
try:
|
||||
from telegram_gate import mirror_alert_to_web, telegram_alerts_enabled
|
||||
except ImportError:
|
||||
telegram_alerts_enabled = lambda: True # type: ignore
|
||||
mirror_alert_to_web = lambda *a, **k: False # type: ignore
|
||||
|
||||
if not telegram_alerts_enabled():
|
||||
LOGGER.info("Telegram sospeso: skip civil_protection")
|
||||
if message_html:
|
||||
mirror_alert_to_web(message_html, "civil_protection", "warning", is_html=True)
|
||||
return False
|
||||
|
||||
token = load_bot_token()
|
||||
if not token:
|
||||
LOGGER.warning("Token Telegram assente. Nessun invio effettuato.")
|
||||
|
||||
Reference in New Issue
Block a user