Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Faker authored and Faker committed Mar 16, 2023
1 parent 9728593 commit 234a567
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 751 deletions.
2 changes: 1 addition & 1 deletion jd_car_play_exchange.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion jd_fen2bean.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions jd_mf_new.js

Large diffs are not rendered by default.

17 changes: 0 additions & 17 deletions jd_opencardDPLHTY.js

This file was deleted.

17 changes: 0 additions & 17 deletions jd_opencardLH.js

This file was deleted.

709 changes: 0 additions & 709 deletions jx_sign.js

This file was deleted.

48 changes: 46 additions & 2 deletions sendNotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const querystring = require('querystring');
const exec = require('child_process').exec;
const $ = new Env();
const timeout = 15000; //超时时间(单位毫秒)
console.log("加载sendNotify,当前版本: 20230309");
console.log("加载sendNotify,当前版本: 20230314");
// =======================================go-cqhttp通知设置区域===========================================
//gobot_url 填写请求地址http://127.0.0.1/send_private_msg
//gobot_token 填写在go-cqhttp文件设置的访问密钥
Expand Down Expand Up @@ -1237,7 +1237,7 @@ function serverNotify(text, desp, time = 2100) {
});
}

function BarkNotify(text, desp, params = {}) {
/* function BarkNotify(text, desp, params = {}) {
return new Promise((resolve) => {
if (BARK_PUSH) {
const options = {
Expand Down Expand Up @@ -1273,6 +1273,50 @@ function BarkNotify(text, desp, params = {}) {
resolve();
}
});
} */


/* code from JoveYu */
function BarkNotify(text, desp, params = {}) {
return new Promise((resolve) => {
if (BARK_PUSH) {
const options = {
url: `${BARK_PUSH}`,
json: {
title: text,
body: desp,
group: `${BARK_GROUP}`,
icon: `${BARK_ICON}`,
sound: `${BARK_SOUND}`,
},
headers: {
'Content-Type': 'application/json; charset=utf-8',
},
timeout,
};
$.post(options, (err, resp, data) => {
try {
if (err) {
console.log('Bark APP发送通知调用API失败!!\n');
console.log(err);
} else {
data = JSON.parse(data);
if (data.code === 200) {
console.log('Bark APP发送通知消息成功🎉\n');
} else {
console.log(`${data.message}\n`);
}
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve();
}
});
} else {
resolve();
}
});
}

function tgBotNotify(text, desp) {
Expand Down

0 comments on commit 234a567

Please sign in to comment.