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

Function QueryFriendList

jd_dreamFactory.js:463–494  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

461}
462//查询助力招工情况
463function QueryFriendList() {
464 return new Promise(async resolve => {
465 $.get(taskurl('friend/QueryFriendList', ``, `_time,zone`), (err, resp, data) => {
466 try {
467 if (err) {
468 console.log(`${JSON.stringify(err)}`)
469 console.log(`${$.name} API请求失败,请检查网路重试`)
470 } else {
471 if (safeGet(data)) {
472 data = JSON.parse(data);
473 if (data['ret'] === 0) {
474 data = data['data'];
475 const { assistListToday = [], assistNumMax, hireListToday = [], hireNumMax } = data;
476 console.log(`\n\n你今日还能帮好友打工(${assistNumMax - assistListToday.length || 0}/${assistNumMax})次\n\n`);
477 if (assistListToday.length === assistNumMax) {
478 $.canHelpFlag = false;
479 }
480 $.log(`【今日招工进度】${hireListToday.length}/${hireNumMax}`);
481 message += `【招工进度】${hireListToday.length}/${hireNumMax}\n`;
482 } else {
483 console.log(`QueryFriendList异常:${JSON.stringify(data)}`)
484 }
485 }
486 }
487 } catch (e) {
488 $.logErr(e, resp)
489 } finally {
490 resolve();
491 }
492 })
493 })
494}
495// 任务领奖
496function completeTask(taskId, taskName) {
497 return new Promise(async resolve => {

Callers 1

jdDreamFactoryFunction · 0.85

Calls 5

taskurlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected