From 2f38d07729494e7bd538a165af84ab307f3aaf5e Mon Sep 17 00:00:00 2001 From: Kuroi_Cc Date: Thu, 5 Oct 2023 11:37:42 +0900 Subject: [PATCH] fix: :bug: The content of the notification contains meaningless leading and trailing whitespace --- backend/src/module/notification/plugin/bark.py | 2 +- backend/src/module/notification/plugin/server_chan.py | 2 +- backend/src/module/notification/plugin/slack.py | 2 +- backend/src/module/notification/plugin/telegram.py | 2 +- backend/src/module/notification/plugin/wecom.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/module/notification/plugin/bark.py b/backend/src/module/notification/plugin/bark.py index 0a360402..0574db1e 100644 --- a/backend/src/module/notification/plugin/bark.py +++ b/backend/src/module/notification/plugin/bark.py @@ -17,7 +17,7 @@ class BarkNotification(RequestContent): text = f""" 番剧名称:{notify.official_title}\n季度: 第{notify.season}季\n更新集数: 第{notify.episode}集\n{notify.poster_path}\n """ - return text + return text.strip() def post_msg(self, notify: Notification) -> bool: text = self.gen_message(notify) diff --git a/backend/src/module/notification/plugin/server_chan.py b/backend/src/module/notification/plugin/server_chan.py index 5e5ca495..517cb0ce 100644 --- a/backend/src/module/notification/plugin/server_chan.py +++ b/backend/src/module/notification/plugin/server_chan.py @@ -18,7 +18,7 @@ class ServerChanNotification(RequestContent): text = f""" 番剧名称:{notify.official_title}\n季度: 第{notify.season}季\n更新集数: 第{notify.episode}集\n{notify.poster_path}\n """ - return text + return text.strip() def post_msg(self, notify: Notification) -> bool: text = self.gen_message(notify) diff --git a/backend/src/module/notification/plugin/slack.py b/backend/src/module/notification/plugin/slack.py index 2100a812..b9cbcf69 100644 --- a/backend/src/module/notification/plugin/slack.py +++ b/backend/src/module/notification/plugin/slack.py @@ -17,7 +17,7 @@ class SlackNotification(RequestContent): text = f""" 番剧名称:{notify.official_title}\n季度: 第{notify.season}季\n更新集数: 第{notify.episode}集\n{notify.poster_path}\n """ - return text + return text.strip() def post_msg(self, notify: Notification) -> bool: text = self.gen_message(notify) diff --git a/backend/src/module/notification/plugin/telegram.py b/backend/src/module/notification/plugin/telegram.py index dbd0c962..2782c493 100644 --- a/backend/src/module/notification/plugin/telegram.py +++ b/backend/src/module/notification/plugin/telegram.py @@ -18,7 +18,7 @@ class TelegramNotification(RequestContent): text = f""" 番剧名称:{notify.official_title}\n季度: 第{notify.season}季\n更新集数: 第{notify.episode}集 """ - return text + return text.strip() def post_msg(self, notify: Notification) -> bool: text = self.gen_message(notify) diff --git a/backend/src/module/notification/plugin/wecom.py b/backend/src/module/notification/plugin/wecom.py index 01c4635f..2e97b4ad 100644 --- a/backend/src/module/notification/plugin/wecom.py +++ b/backend/src/module/notification/plugin/wecom.py @@ -20,7 +20,7 @@ class WecomNotification(RequestContent): text = f""" 番剧名称:{notify.official_title}\n季度: 第{notify.season}季\n更新集数: 第{notify.episode}集\n{notify.poster_path}\n """ - return text + return text.strip() def post_msg(self, notify: Notification) -> bool: ##Change message format to match Wecom push better