From 521d3f20d8cb03165f5a79b2f4c92d3c624ddc34 Mon Sep 17 00:00:00 2001 From: shininome Date: Mon, 9 Oct 2023 09:38:28 +0800 Subject: [PATCH] fix telegram notification wrong when no image --- backend/src/module/notification/plugin/telegram.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/src/module/notification/plugin/telegram.py b/backend/src/module/notification/plugin/telegram.py index ac35623d..c8cd2a59 100644 --- a/backend/src/module/notification/plugin/telegram.py +++ b/backend/src/module/notification/plugin/telegram.py @@ -26,13 +26,12 @@ class TelegramNotification(RequestContent): data = { "chat_id": self.chat_id, "caption": text, + "text": text, "disable_notification": True, } photo = load_image(notify.poster_path) if photo: - resp = self.post_files( - self.photo_url, data, files={"photo": photo} - ) + resp = self.post_files(self.photo_url, data, files={"photo": photo}) else: resp = self.post_data(self.message_url, data) logger.debug(f"Telegram notification: {resp.status_code}")