From 19153d01f397315d401a1890f36a81705fb0e48d Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Thu, 25 Mar 2021 16:54:55 +0800 Subject: [PATCH] =?UTF-8?q?tgbot=E9=80=9A=E7=9F=A5=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E6=94=AF=E6=8C=81markdown=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sendNotify.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sendNotify.js b/sendNotify.js index ac47b650..abb0e3fc 100644 --- a/sendNotify.js +++ b/sendNotify.js @@ -311,10 +311,9 @@ function BarkNotify(text, desp, params={}) { function tgBotNotify(text, desp) { return new Promise(resolve => { if (TG_BOT_TOKEN && TG_USER_ID) { - desp = `${desp.replace(/_/g, "\\_")}`;//支持markdown后,带有_会导致推送失败,转义一下 const options = { url: `https://${TG_API_HOST}/bot${TG_BOT_TOKEN}/sendMessage`, - body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}&disable_web_page_preview=true&parse_mode=Markdown`, + body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}&disable_web_page_preview=true`, headers: { 'Content-Type': 'application/x-www-form-urlencoded' }