MCPcopy Create free account
hub / github.com/Semporia/Scripts / getMessage

Function getMessage

jd_jxnc.js:461–489  ·  view source on GitHub ↗
(endInfo, startInfo)

Source from the content-addressed store, hash-verified

459}
460
461function getMessage(endInfo, startInfo) {
462 const need = endInfo.target - endInfo.score;
463 const get = endInfo.modifyscore; // 本次变更获得水滴
464 const leaveGet = startInfo.modifyscore; // 离开时获得水滴
465 let dayGet = 0; // 今日共获取水滴数
466 if ($.detail) {
467 let dayTime = new Date(new Date().toLocaleDateString()).getTime() / 1000; // 今日 0 点时间戳(10位数)
468 $.detail.forEach(function (item, index) {
469 if (item.time >= dayTime && item.score) {
470 dayGet += item.score;
471 }
472 });
473 }
474 message += `【水滴】本次获得${get} 离线获得${leaveGet} 今日获得${dayGet} 还需水滴${need}\n`;
475 if (need <= 0) {
476 notifyBool = true;
477 message += `【成熟】水果已成熟请及时收取,deliverState:${endInfo.deliverState}\n`;
478 return;
479 }
480 if (get > 0 || leaveGet > 0 || dayGet > 0) {
481 const day = Math.ceil(need / (dayGet > 0 ? dayGet : (get + leaveGet)));
482 message += `【预测】还需 ${day} 天\n`;
483 }
484 if (get > 0 || leaveGet > 0) { // 本次 或 离线 有水滴
485 notifyBool = notifyBool && notifyLevel >= 1;
486 } else {
487 notifyBool = notifyBool && notifyLevel >= 2;
488 }
489}
490
491// 提交助力码
492function submitInviteId(userName) {

Callers 1

jdJXNCFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected