This commit is contained in:
lxk0301
2021-03-16 15:06:51 +08:00
parent 195c3e72f3
commit 304fd85c5e
2 changed files with 10 additions and 10 deletions

View File

@ -291,7 +291,7 @@ function redPacket() {
t.setDate(t.getDate() + 1)
t.setHours(0, 0, 0, 0)
t = parseInt((t - 1) / 1000)
for (let vo of data.useRedInfo.redList) {
for (let vo of data.useRedInfo.redList || []) {
if (vo.activityName.includes("京喜")) {
$.jxRed += parseFloat(vo.balance)
if (vo['endTime'] === t) {

View File

@ -175,7 +175,7 @@ function serverNotify(text, desp, timeout = 2100) {
data = JSON.parse(data);
//server酱和Server酱·Turbo版的返回json格式不太一样
if (data.errno === 0 || data.data.errno === 0 ) {
console.log('server酱发送通知消息成功\n')
console.log('server酱发送通知消息成功🎉\n')
} else if (data.errno === 1024) {
// 一分钟内发送相同的内容会触发
console.log(`server酱发送通知消息异常: ${data.errmsg}\n`)
@ -249,7 +249,7 @@ function CoolPush(text, desp) {
} else {
data = JSON.parse(data);
if (data.code === 200) {
console.log(`酷推发送${pushMode(QQ_MODE)}通知消息成功\n`)
console.log(`酷推发送${pushMode(QQ_MODE)}通知消息成功🎉\n`)
} else if (data.code === 400) {
console.log(`QQ酷推(Cool Push)发送${pushMode(QQ_MODE)}推送失败:${data.msg}\n`)
} else if (data.code === 503) {
@ -288,7 +288,7 @@ function BarkNotify(text, desp, params={}) {
} else {
data = JSON.parse(data);
if (data.code === 200) {
console.log('Bark APP发送通知消息成功\n')
console.log('Bark APP发送通知消息成功🎉\n')
} else {
console.log(`${data.message}\n`);
}
@ -309,7 +309,7 @@ function BarkNotify(text, desp, params={}) {
function tgBotNotify(text, desp) {
return new Promise(resolve => {
if (TG_BOT_TOKEN && TG_USER_ID) {
desp = `${desp.replace("_", "\\_")}`;//支持markdown后带有_会导致推送失败转义一下
desp = `${desp.replace(/_/g, "\\_")}`;//支持markdown后带有_会导致推送失败转义一下
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&parse_mode=Markdown`,
@ -337,7 +337,7 @@ function tgBotNotify(text, desp) {
} else {
data = JSON.parse(data);
if (data.ok) {
console.log('Telegram发送通知消息成。\n')
console.log('Telegram发送通知消息成功🎉。\n')
} else if (data.error_code === 400) {
console.log('请主动给bot发送一条消息并检查接收用户ID是否正确。\n')
} else if (data.error_code === 401){
@ -385,7 +385,7 @@ function ddBotNotify(text, desp) {
} else {
data = JSON.parse(data);
if (data.errcode === 0) {
console.log('钉钉发送通知消息成。\n')
console.log('钉钉发送通知消息成功🎉。\n')
} else {
console.log(`${data.errmsg}\n`)
}
@ -446,7 +446,7 @@ function qywxBotNotify(text, desp) {
} else {
data = JSON.parse(data);
if (data.errcode === 0) {
console.log('企业微信发送通知消息成。\n');
console.log('企业微信发送通知消息成功🎉。\n');
} else {
console.log(`${data.errmsg}\n`);
}
@ -572,7 +572,7 @@ function qywxamNotify(text, desp) {
} else {
data = JSON.parse(data);
if (data.errcode === 0) {
console.log('成员ID:' + ChangeUserId(desp) + '企业微信应用消息发送通知消息成。\n');
console.log('成员ID:' + ChangeUserId(desp) + '企业微信应用消息发送通知消息成功🎉。\n');
} else {
console.log(`${data.errmsg}\n`);
}
@ -616,7 +616,7 @@ function iGotNotify(text, desp, params={}){
} else {
if(typeof data === 'string') data = JSON.parse(data);
if (data.ret === 0) {
console.log('iGot发送通知消息成功\n')
console.log('iGot发送通知消息成功🎉\n')
} else {
console.log(`iGot发送通知消息失败${data.errMsg}\n`)
}