From 950b431ce163006b985fd749f3206612ab89790e Mon Sep 17 00:00:00 2001 From: leic4u <32786903+leic4u@users.noreply.github.com> Date: Sat, 18 Nov 2023 21:04:46 +0800 Subject: [PATCH] Fix telegram message formatting (#488) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Removed the `
` tag
2. Change the 'disable_web_page_preview' to false to avoid too many invalid infomation 避免过多的无效信息干扰

Signed-off-by: leic4u <32786903+leic4u@users.noreply.github.com>
---
 libs/funcs.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libs/funcs.py b/libs/funcs.py
index f3e81a0a13a..362be6c8d21 100644
--- a/libs/funcs.py
+++ b/libs/funcs.py
@@ -189,9 +189,9 @@ async def send2tg(self, tg_token, title, content):
                     title_sp[1] = '-'.join(title1)
                 title = ' '.join(title_sp)
 
-                content = content.replace('\\r\\n', '\n
')
-                d = {'chat_id': str(chat_id), 'text': '' + title + '' + '\n
' + content + '
\n' + - '------QD提醒------', 'disable_web_page_preview': 'false', 'parse_mode': 'HTML'} + content = content.replace('\\r\\n', '\n') + d = {'chat_id': str(chat_id), 'text': '' + title + '' + '\n' + content + '\n' + + '------QD提醒------', 'disable_web_page_preview': 'true', 'parse_mode': 'HTML'} if proxy: async with aiohttp.ClientSession(conn_timeout=config.connect_timeout) as session: async with session.post(link, json=d, verify_ssl=False, proxy=proxy, timeout=config.request_timeout) as res: