mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 02:48:44 +08:00
update
This commit is contained in:
parent
a5aec53565
commit
8f09ea3fa3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -21,7 +21,7 @@ const querystring = require('querystring');
|
|||||||
const exec = require('child_process').exec;
|
const exec = require('child_process').exec;
|
||||||
const $ = new Env();
|
const $ = new Env();
|
||||||
const timeout = 15000; //超时时间(单位毫秒)
|
const timeout = 15000; //超时时间(单位毫秒)
|
||||||
console.log("加载sendNotify,当前版本: 20230309");
|
console.log("加载sendNotify,当前版本: 20230314");
|
||||||
// =======================================go-cqhttp通知设置区域===========================================
|
// =======================================go-cqhttp通知设置区域===========================================
|
||||||
//gobot_url 填写请求地址http://127.0.0.1/send_private_msg
|
//gobot_url 填写请求地址http://127.0.0.1/send_private_msg
|
||||||
//gobot_token 填写在go-cqhttp文件设置的访问密钥
|
//gobot_token 填写在go-cqhttp文件设置的访问密钥
|
||||||
@ -1237,7 +1237,7 @@ function serverNotify(text, desp, time = 2100) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function BarkNotify(text, desp, params = {}) {
|
/* function BarkNotify(text, desp, params = {}) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
if (BARK_PUSH) {
|
if (BARK_PUSH) {
|
||||||
const options = {
|
const options = {
|
||||||
@ -1273,6 +1273,50 @@ function BarkNotify(text, desp, params = {}) {
|
|||||||
resolve();
|
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) {
|
function tgBotNotify(text, desp) {
|
||||||
|
Loading…
Reference in New Issue
Block a user