Small fix

This commit is contained in:
Profitroll 2022-09-24 17:03:20 +02:00
parent 0e14ca600f
commit 46e3665749

View File

@ -157,27 +157,33 @@ def send_content():
else: else:
caption = caption caption = caption
if ext_type == "photo": # type: ignore try:
if ext_type == "photo": # type: ignore
if configGet("enabled", "caption"): if configGet("enabled", "caption"):
if configGet("link", "caption") != None: if configGet("link", "caption") != None:
sent = app.send_photo(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore sent = app.send_photo(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore
else:
sent = app.send_photo(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore
else: else:
sent = app.send_photo(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore sent = app.send_photo(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore
else:
sent = app.send_photo(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore
elif ext_type == "video": # type: ignore elif ext_type == "video": # type: ignore
if configGet("enabled", "caption"): if configGet("enabled", "caption"):
if configGet("link", "caption") != None: if configGet("link", "caption") != None:
sent = app.send_video(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore sent = app.send_video(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore
else:
sent = app.send_video(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore
else: else:
sent = app.send_video(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore sent = app.send_video(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore
else:
sent = app.send_video(configGet("channel", "posting"), candidate, caption=caption, disable_notification=configGet("silent", "posting")) # type: ignore
else: else:
return
except Exception as exp:
logWrite(locale("post_exception", "console", locale=configGet("locale_log")).format(str(exp), format_exc()))
if configGet("error", "reports"):
app.send_message(configGet("admin"), locale("post_exception", "message", locale=configGet("locale")).format(exp, traceback.format_exc())) # type: ignore
return return
index["sent"].append(candidate_file) index["sent"].append(candidate_file)
@ -199,7 +205,7 @@ def send_content():
logWrite(locale("post_exception", "console", locale=configGet("locale_log")).format(str(exp), format_exc())) logWrite(locale("post_exception", "console", locale=configGet("locale_log")).format(str(exp), format_exc()))
if configGet("error", "reports"): if configGet("error", "reports"):
app.send_message(configGet("admin"), locale("post_exception", "message", locale=configGet("locale")).format(exp, traceback.format_exc())) # type: ignore app.send_message(configGet("admin"), locale("post_exception", "message", locale=configGet("locale")).format(exp, traceback.format_exc())) # type: ignore
pass return
# Work in progress # Work in progress