Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexq authored and Nexq committed May 17, 2022
1 parent f197be4 commit 0546a9f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sendNotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const querystring = require('querystring');
const exec = require('child_process').exec;
const $ = new Env();
const timeout = 15000; //超时时间(单位毫秒)
console.log("加载sendNotify,当前版本: 20220516");
console.log("加载sendNotify,当前版本: 20220517");
// =======================================go-cqhttp通知设置区域===========================================
//gobot_url 填写请求地址http://127.0.0.1/send_private_msg
//gobot_token 填写在go-cqhttp文件设置的访问密钥
Expand Down Expand Up @@ -246,6 +246,7 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc
var Use_WxPusher = true;
var strtext = text;
var strdesp = desp;
var titleIndex =-1;
if (process.env.NOTIFY_NOCKFALSE) {
Notify_NoCKFalse = process.env.NOTIFY_NOCKFALSE;
}
Expand Down Expand Up @@ -403,13 +404,14 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc
return;
}
}

if (strtext.indexOf("cookie已失效") != -1 || strdesp.indexOf("重新登录获取") != -1 || strtext == "Ninja 运行通知") {
if (Notify_NoCKFalse == "true" && text != "Ninja 运行通知") {
console.log(`检测到NOTIFY_NOCKFALSE变量为true,不发送ck失效通知...`);
return;
}
}

if (text.indexOf("已可领取") != -1) {
if (text.indexOf("农场") != -1) {
strTitle = "东东农场领取";
Expand All @@ -430,6 +432,7 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc
if (text.indexOf("任务") != -1 && (text.indexOf("新增") != -1 || text.indexOf("删除") != -1)) {
strTitle = "脚本任务更新";
}

if (strTitle) {
const notifyRemindList = process.env.NOTIFY_NOREMIND ? process.env.NOTIFY_NOREMIND.split('&') : [];
titleIndex = notifyRemindList.findIndex((item) => item === strTitle);
Expand All @@ -442,7 +445,6 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc
} else {
strTitle = text;
}

if (Notify_NoLoginSuccess == "true") {
if (desp.indexOf("登陆成功") != -1) {
console.log(`登陆成功不推送`);
Expand All @@ -463,7 +465,7 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc

//检查黑名单屏蔽通知
const notifySkipList = process.env.NOTIFY_SKIP_LIST ? process.env.NOTIFY_SKIP_LIST.split('&') : [];
let titleIndex = notifySkipList.findIndex((item) => item === strTitle);
titleIndex = notifySkipList.findIndex((item) => item === strTitle);

if (titleIndex !== -1) {
console.log(`${strTitle} 在推送黑名单中,已跳过推送`);
Expand Down

0 comments on commit 0546a9f

Please sign in to comment.