From 5eb3da8e958ff5cfda64a80d898b14bc819d6066 Mon Sep 17 00:00:00 2001 From: wapftp <154718846+wapftp@users.noreply.github.com> Date: Mon, 8 Jul 2024 22:35:36 +0800 Subject: [PATCH] Update telegram_notification.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #增加TG文本消息MarkdownV2格式 --- task/utils/notification/telegram_notification.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/task/utils/notification/telegram_notification.py b/task/utils/notification/telegram_notification.py index 9765450..235e5b7 100644 --- a/task/utils/notification/telegram_notification.py +++ b/task/utils/notification/telegram_notification.py @@ -26,7 +26,7 @@ def send(self, to, header, content): raise Exception('没有设置 chat_id,无法发送 Telegram 通知') r = requests.get( - 'https://api.telegram.org/bot{}/sendMessage?chat_id={}&text={}'. + 'https://api.telegram.org/bot{}/sendMessage?chat_id={}&text={}&parse_mode=MarkdownV2'. format(self.token, to, urllib.parse.quote_plus('{}: {}'.format(header, content)))) result = r.json()