KingRan 2022-02-18 00:18:18 +08:00
parent 2cfffded46
commit dea210ea44
2 changed files with 232 additions and 6 deletions

View File

@ -31,7 +31,7 @@ const querystring = require('querystring');
const exec = require('child_process').exec;
const $ = new Env();
const timeout = 15000; //超时时间(单位毫秒)
console.log("加载sendNotify当前版本: 20220128");
console.log("加载sendNotify当前版本: 20220217");
// =======================================go-cqhttp通知设置区域===========================================
//gobot_url 填写请求地址http://127.0.0.1/send_private_msg
//gobot_token 填写在go-cqhttp文件设置的访问密钥
@ -485,7 +485,9 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By ht
const titleIndexGp5 = notifyGroup5List.findIndex((item) => item === strTitle);
const notifyGroup6List = process.env.NOTIFY_GROUP6_LIST ? process.env.NOTIFY_GROUP6_LIST.split('&') : [];
const titleIndexGp6 = notifyGroup6List.findIndex((item) => item === strTitle);
const notifyGroup7List = process.env.NOTIFY_GROUP7_LIST ? process.env.NOTIFY_GROUP7_LIST.split('&') : [];
const titleIndexGp7 = notifyGroup7List.findIndex((item) => item === strTitle);
if (titleIndex2 !== -1) {
console.log(`${strTitle} 在群组2推送名单中初始化群组推送`);
UseGroupNotify = 2;
@ -505,6 +507,10 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By ht
if (titleIndexGp6 !== -1) {
console.log(`${strTitle} 在群组6推送名单中初始化群组推送`);
UseGroupNotify = 6;
}
if (titleIndexGp7 !== -1) {
console.log(`${strTitle} 在群组7推送名单中初始化群组推送`);
UseGroupNotify = 7;
}
if (process.env.NOTIFY_CUSTOMNOTIFY) {
strCustom = process.env.NOTIFY_CUSTOMNOTIFY;
@ -541,7 +547,10 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By ht
console.log("自定义设定强制使用组6配置通知...");
UseGroupNotify = 6;
}
if (strCustomTempArr[1] == "组7") {
console.log("自定义设定强制使用组6配置通知...");
UseGroupNotify = 7;
}
if (strCustomTempArr.length > 2) {
console.log("关闭所有通知变量...");
Use_serverNotify = false;
@ -1246,6 +1255,110 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By ht
if (process.env.GOTIFY_PRIORITY6) {
GOTIFY_PRIORITY = process.env.GOTIFY_PRIORITY6;
}
break;
case 7:
//==========================第七套环境变量赋值=========================
if (process.env.GOBOT_URL7 && Use_gobotNotify) {
GOBOT_URL = process.env.GOBOT_URL7;
}
if (process.env.GOBOT_TOKEN7 && Use_gobotNotify) {
GOBOT_TOKEN = process.env.GOBOT_TOKEN7;
}
if (process.env.GOBOT_QQ7 && Use_gobotNotify) {
GOBOT_QQ = process.env.GOBOT_QQ7;
}
if (process.env.PUSH_KEY7 && Use_serverNotify) {
SCKEY = process.env.PUSH_KEY7;
}
if (process.env.WP_APP_TOKEN7 && Use_WxPusher) {
WP_APP_TOKEN = process.env.WP_APP_TOKEN7;
}
if (process.env.WP_TOPICIDS7 && Use_WxPusher) {
WP_TOPICIDS = process.env.WP_TOPICIDS7;
}
if (process.env.WP_UIDS7 && Use_WxPusher) {
WP_UIDS = process.env.WP_UIDS7;
}
if (process.env.WP_URL7 && Use_WxPusher) {
WP_URL = process.env.WP_URL7;
}
if (process.env.BARK_PUSH7 && Use_BarkNotify) {
if (process.env.BARK_PUSH7.indexOf('https') > -1 || process.env.BARK_PUSH7.indexOf('http') > -1) {
//兼容BARK自建用户
BARK_PUSH = process.env.BARK_PUSH7;
} else {
BARK_PUSH = `https://api.day.app/${process.env.BARK_PUSH7}`;
}
if (process.env.BARK_SOUND7) {
BARK_SOUND = process.env.BARK_SOUND7;
}
if (process.env.BARK_GROUP7) {
BARK_GROUP = process.env.BARK_GROUP7;
}
}
if (process.env.TG_BOT_TOKEN7 && Use_tgBotNotify) {
TG_BOT_TOKEN = process.env.TG_BOT_TOKEN7;
}
if (process.env.TG_USER_ID7 && Use_tgBotNotify) {
TG_USER_ID = process.env.TG_USER_ID7;
}
if (process.env.TG_PROXY_AUTH7 && Use_tgBotNotify)
TG_PROXY_AUTH = process.env.TG_PROXY_AUTH7;
if (process.env.TG_PROXY_HOST7 && Use_tgBotNotify)
TG_PROXY_HOST = process.env.TG_PROXY_HOST7;
if (process.env.TG_PROXY_PORT7 && Use_tgBotNotify)
TG_PROXY_PORT = process.env.TG_PROXY_PORT7;
if (process.env.TG_API_HOST7 && Use_tgBotNotify)
TG_API_HOST = process.env.TG_API_HOST7;
if (process.env.DD_BOT_TOKEN7 && Use_ddBotNotify) {
DD_BOT_TOKEN = process.env.DD_BOT_TOKEN7;
if (process.env.DD_BOT_SECRET7) {
DD_BOT_SECRET = process.env.DD_BOT_SECRET7;
}
}
if (process.env.QYWX_KEY7 && Use_qywxBotNotify) {
QYWX_KEY = process.env.QYWX_KEY7;
}
if (process.env.QYWX_AM7 && Use_qywxamNotify) {
QYWX_AM = process.env.QYWX_AM7;
}
if (process.env.IGOT_PUSH_KEY7 && Use_iGotNotify) {
IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY7;
}
if (process.env.PUSH_PLUS_TOKEN7 && Use_pushPlusNotify) {
PUSH_PLUS_TOKEN = process.env.PUSH_PLUS_TOKEN7;
}
if (process.env.PUSH_PLUS_USER7 && Use_pushPlusNotify) {
PUSH_PLUS_USER = process.env.PUSH_PLUS_USER7;
}
if (process.env.PUSH_PLUS_TOKEN_hxtrip7 && Use_pushPlushxtripNotify) {
PUSH_PLUS_TOKEN_hxtrip = process.env.PUSH_PLUS_TOKEN_hxtrip7;
}
if (process.env.PUSH_PLUS_USER_hxtrip7 && Use_pushPlushxtripNotify) {
PUSH_PLUS_USER_hxtrip = process.env.PUSH_PLUS_USER_hxtrip7;
}
if (process.env.GOTIFY_URL7) {
GOTIFY_URL = process.env.GOTIFY_URL7;
}
if (process.env.GOTIFY_TOKEN7) {
GOTIFY_TOKEN = process.env.GOTIFY_TOKEN7;
}
if (process.env.GOTIFY_PRIORITY7) {
GOTIFY_PRIORITY = process.env.GOTIFY_PRIORITY7;
}
break;
}

View File

@ -31,7 +31,7 @@ const querystring = require('querystring');
const exec = require('child_process').exec;
const $ = new Env();
const timeout = 15000; //超时时间(单位毫秒)
console.log("加载sendNotify当前版本: 20220128");
console.log("加载sendNotify当前版本: 20220217");
// =======================================go-cqhttp通知设置区域===========================================
//gobot_url 填写请求地址http://127.0.0.1/send_private_msg
//gobot_token 填写在go-cqhttp文件设置的访问密钥
@ -485,7 +485,9 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By ht
const titleIndexGp5 = notifyGroup5List.findIndex((item) => item === strTitle);
const notifyGroup6List = process.env.NOTIFY_GROUP6_LIST ? process.env.NOTIFY_GROUP6_LIST.split('&') : [];
const titleIndexGp6 = notifyGroup6List.findIndex((item) => item === strTitle);
const notifyGroup7List = process.env.NOTIFY_GROUP7_LIST ? process.env.NOTIFY_GROUP7_LIST.split('&') : [];
const titleIndexGp7 = notifyGroup7List.findIndex((item) => item === strTitle);
if (titleIndex2 !== -1) {
console.log(`${strTitle} 在群组2推送名单中初始化群组推送`);
UseGroupNotify = 2;
@ -505,6 +507,10 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By ht
if (titleIndexGp6 !== -1) {
console.log(`${strTitle} 在群组6推送名单中初始化群组推送`);
UseGroupNotify = 6;
}
if (titleIndexGp7 !== -1) {
console.log(`${strTitle} 在群组7推送名单中初始化群组推送`);
UseGroupNotify = 7;
}
if (process.env.NOTIFY_CUSTOMNOTIFY) {
strCustom = process.env.NOTIFY_CUSTOMNOTIFY;
@ -541,7 +547,10 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By ht
console.log("自定义设定强制使用组6配置通知...");
UseGroupNotify = 6;
}
if (strCustomTempArr[1] == "组7") {
console.log("自定义设定强制使用组6配置通知...");
UseGroupNotify = 7;
}
if (strCustomTempArr.length > 2) {
console.log("关闭所有通知变量...");
Use_serverNotify = false;
@ -1246,6 +1255,110 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By ht
if (process.env.GOTIFY_PRIORITY6) {
GOTIFY_PRIORITY = process.env.GOTIFY_PRIORITY6;
}
break;
case 7:
//==========================第七套环境变量赋值=========================
if (process.env.GOBOT_URL7 && Use_gobotNotify) {
GOBOT_URL = process.env.GOBOT_URL7;
}
if (process.env.GOBOT_TOKEN7 && Use_gobotNotify) {
GOBOT_TOKEN = process.env.GOBOT_TOKEN7;
}
if (process.env.GOBOT_QQ7 && Use_gobotNotify) {
GOBOT_QQ = process.env.GOBOT_QQ7;
}
if (process.env.PUSH_KEY7 && Use_serverNotify) {
SCKEY = process.env.PUSH_KEY7;
}
if (process.env.WP_APP_TOKEN7 && Use_WxPusher) {
WP_APP_TOKEN = process.env.WP_APP_TOKEN7;
}
if (process.env.WP_TOPICIDS7 && Use_WxPusher) {
WP_TOPICIDS = process.env.WP_TOPICIDS7;
}
if (process.env.WP_UIDS7 && Use_WxPusher) {
WP_UIDS = process.env.WP_UIDS7;
}
if (process.env.WP_URL7 && Use_WxPusher) {
WP_URL = process.env.WP_URL7;
}
if (process.env.BARK_PUSH7 && Use_BarkNotify) {
if (process.env.BARK_PUSH7.indexOf('https') > -1 || process.env.BARK_PUSH7.indexOf('http') > -1) {
//兼容BARK自建用户
BARK_PUSH = process.env.BARK_PUSH7;
} else {
BARK_PUSH = `https://api.day.app/${process.env.BARK_PUSH7}`;
}
if (process.env.BARK_SOUND7) {
BARK_SOUND = process.env.BARK_SOUND7;
}
if (process.env.BARK_GROUP7) {
BARK_GROUP = process.env.BARK_GROUP7;
}
}
if (process.env.TG_BOT_TOKEN7 && Use_tgBotNotify) {
TG_BOT_TOKEN = process.env.TG_BOT_TOKEN7;
}
if (process.env.TG_USER_ID7 && Use_tgBotNotify) {
TG_USER_ID = process.env.TG_USER_ID7;
}
if (process.env.TG_PROXY_AUTH7 && Use_tgBotNotify)
TG_PROXY_AUTH = process.env.TG_PROXY_AUTH7;
if (process.env.TG_PROXY_HOST7 && Use_tgBotNotify)
TG_PROXY_HOST = process.env.TG_PROXY_HOST7;
if (process.env.TG_PROXY_PORT7 && Use_tgBotNotify)
TG_PROXY_PORT = process.env.TG_PROXY_PORT7;
if (process.env.TG_API_HOST7 && Use_tgBotNotify)
TG_API_HOST = process.env.TG_API_HOST7;
if (process.env.DD_BOT_TOKEN7 && Use_ddBotNotify) {
DD_BOT_TOKEN = process.env.DD_BOT_TOKEN7;
if (process.env.DD_BOT_SECRET7) {
DD_BOT_SECRET = process.env.DD_BOT_SECRET7;
}
}
if (process.env.QYWX_KEY7 && Use_qywxBotNotify) {
QYWX_KEY = process.env.QYWX_KEY7;
}
if (process.env.QYWX_AM7 && Use_qywxamNotify) {
QYWX_AM = process.env.QYWX_AM7;
}
if (process.env.IGOT_PUSH_KEY7 && Use_iGotNotify) {
IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY7;
}
if (process.env.PUSH_PLUS_TOKEN7 && Use_pushPlusNotify) {
PUSH_PLUS_TOKEN = process.env.PUSH_PLUS_TOKEN7;
}
if (process.env.PUSH_PLUS_USER7 && Use_pushPlusNotify) {
PUSH_PLUS_USER = process.env.PUSH_PLUS_USER7;
}
if (process.env.PUSH_PLUS_TOKEN_hxtrip7 && Use_pushPlushxtripNotify) {
PUSH_PLUS_TOKEN_hxtrip = process.env.PUSH_PLUS_TOKEN_hxtrip7;
}
if (process.env.PUSH_PLUS_USER_hxtrip7 && Use_pushPlushxtripNotify) {
PUSH_PLUS_USER_hxtrip = process.env.PUSH_PLUS_USER_hxtrip7;
}
if (process.env.GOTIFY_URL7) {
GOTIFY_URL = process.env.GOTIFY_URL7;
}
if (process.env.GOTIFY_TOKEN7) {
GOTIFY_TOKEN = process.env.GOTIFY_TOKEN7;
}
if (process.env.GOTIFY_PRIORITY7) {
GOTIFY_PRIORITY = process.env.GOTIFY_PRIORITY7;
}
break;
}