From fcd59b7acaa70b88a5d77069756979a857b07e88 Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Fri, 17 Feb 2023 23:18:34 +0100 Subject: [PATCH] Fixed caption display --- modules/sender.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/sender.py b/modules/sender.py index 2e10218..7e6adfb 100644 --- a/modules/sender.py +++ b/modules/sender.py @@ -70,10 +70,10 @@ async def send_content(app: PosterClient) -> None: del response - submitted_caption = col_submitted.find_one( {"temp.file": pic[1]} ) + submitted = col_submitted.find_one({"temp.file": pic[1]}) - if submitted_caption is not None: - caption = submitted_caption["caption"].strip() + if submitted is not None and submitted["caption"] is not None: + caption = submitted["caption"].strip() else: caption = "" @@ -100,7 +100,7 @@ async def send_content(app: PosterClient) -> None: "image": pic[0], "filename": pic[1], "channel": configGet("channel", "posting"), - "caption": None if submitted_caption is None else submitted_caption["caption"].strip() + "caption": None if (submitted is None or submitted["caption"] is None) else submitted["caption"].strip() } )