tgbot通知去掉支持markdown模式

This commit is contained in:
lxk0301
2021-03-25 16:54:55 +08:00
parent fedf92f235
commit e365901113

View File

@@ -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'
}