From 5f90676942487f254ce5be0676b349f44d6d4a75 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Tue, 16 Mar 2021 12:08:34 +0800 Subject: [PATCH] =?UTF-8?q?tg=E6=8E=A8=E9=80=81=E6=94=AF=E6=8C=81markdown?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_necklace.js | 2 +- sendNotify.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jd_necklace.js b/jd_necklace.js index d02572d7..0316682d 100644 --- a/jd_necklace.js +++ b/jd_necklace.js @@ -99,7 +99,7 @@ function showMsg() { // 云端大于10元无门槛红包时进行通知推送 // if ($.isNode() && $.totalScore >= 20000 && nowTimes.getHours() >= 20) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `京东账号${$.index} ${$.nickName}\n当前${$.name}:${$.totalScore}个\n可兑换无门槛红包:${$.totalScore / 1000}元\n点击链接即可去兑换(注:此红包具有时效性)\n↓↓↓ \n\n ${openUrl} \n\n ↑↑↑`, { url: openUrl }) if ($.isNode() && nowTimes.getHours() >= 20 && (process.env.DDQ_NOTIFY_CONTROL ? process.env.DDQ_NOTIFY_CONTROL === 'false' : !!1)) { - allMessage += `京东账号${$.index} ${$.nickName}\n当前${$.name}:${$.totalScore}个\n可兑换无门槛红包:${$.totalScore / 1000}元\n(京东APP->领券->左上角点点券.注:此红包具有时效性)${$.index !== cookiesArr.length ? '\n\n' : `\n↓↓↓ \n\n ${openUrl} \n\n ↑↑↑`}` + allMessage += `京东账号${$.index} ${$.nickName}\n当前${$.name}:${$.totalScore}个\n可兑换无门槛红包:${$.totalScore / 1000}元\n(京东APP->领券->左上角点点券.注:此红包具有时效性)${$.index !== cookiesArr.length ? '\n\n' : `\n↓↓↓ \n\n "https://h5.m.jd.com/babelDiy/Zeus/41Lkp7DumXYCFmPYtU3LTcnTTXTX/index.html" \n\n ↑↑↑`}` } resolve() }) diff --git a/sendNotify.js b/sendNotify.js index 81f68804..eebcbbaa 100644 --- a/sendNotify.js +++ b/sendNotify.js @@ -2,7 +2,7 @@ * @Author: lxk0301 https://gitee.com/lxk0301 * @Date: 2020-08-19 16:12:40 * @Last Modified by: lxk0301 - * @Last Modified time: 2021-3-15 9:52:54 + * @Last Modified time: 2021-3-16 9:52:54 */ const querystring = require("querystring"); const $ = new Env(); @@ -311,18 +311,18 @@ function tgBotNotify(text, desp) { if (TG_BOT_TOKEN && TG_USER_ID) { 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`, + body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}&disable_web_page_preview=true&parse_mode=Markdown`, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } } - if (process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) { + if (TG_PROXY_HOST && TG_PROXY_PORT) { const tunnel = require("tunnel"); const agent = { https: tunnel.httpsOverHttp({ proxy: { - host: process.env.TG_PROXY_HOST, - port: process.env.TG_PROXY_PORT * 1 + host: TG_PROXY_HOST, + port: TG_PROXY_PORT * 1 } }) }