diff --git a/apps/notifier/notification_manager.py b/apps/notifier/notification_manager.py index 99c8f18..a7d262b 100644 --- a/apps/notifier/notification_manager.py +++ b/apps/notifier/notification_manager.py @@ -83,20 +83,20 @@ def send_notify(self, data, notify_name, assistant_name: str): extra_data = {} if isinstance(telegram, dict): extra_data = telegram - if caption == "": - caption = ("{}\n{}".format(titolo,messaggio)) - if image != "" and image.find("http") != -1: - url_data = {"url": image, - "caption": caption, - "timeout": 90 - } - extra_data.update({"photo":url_data}) - if image != "" and image.find("http") == -1: - file_data = {"file": image, - "caption": caption, - "timeout": 90 - } - extra_data.update({"photo":file_data}) + if caption == "": + caption = ("{}\n{}".format(titolo,messaggio)) + if image != "" and image.find("http") != -1: + url_data = {"url": image, + "caption": caption, + "timeout": 90 + } + extra_data.update({"photo":url_data}) + if image != "" and image.find("http") == -1: + file_data = {"file": image, + "caption": caption, + "timeout": 90 + } + extra_data.update({"photo":file_data}) if str(html).lower() not in ["true","on","yes","1"]: messaggio = messaggio.replace("_","\_") if link !="":