Backup automatico script del 2026-07-19 07:00
This commit is contained in:
@@ -1619,6 +1619,13 @@ def format_route_ice_report(df: pd.DataFrame, city1: str, city2: str) -> str:
|
||||
return msg
|
||||
|
||||
def send_telegram_broadcast(token, message, debug_mode=False):
|
||||
try:
|
||||
from telegram_gate import telegram_alerts_enabled
|
||||
except ImportError:
|
||||
telegram_alerts_enabled = lambda: True # type: ignore
|
||||
|
||||
if not telegram_alerts_enabled():
|
||||
return
|
||||
base_url = f"https://api.telegram.org/bot{token}/sendMessage"
|
||||
recipients = [ADMIN_CHAT_ID] if debug_mode else TELEGRAM_CHAT_IDS
|
||||
|
||||
@@ -1793,6 +1800,13 @@ def generate_route_ice_map(df: pd.DataFrame, city1: str, city2: str, output_path
|
||||
|
||||
def send_telegram_photo(token, photo_path, caption, debug_mode=False):
|
||||
"""Invia foto via Telegram API."""
|
||||
try:
|
||||
from telegram_gate import telegram_alerts_enabled
|
||||
except ImportError:
|
||||
telegram_alerts_enabled = lambda: True # type: ignore
|
||||
|
||||
if not telegram_alerts_enabled():
|
||||
return False
|
||||
if not os.path.exists(photo_path):
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user