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

Function doHelp

jd_plantBean.js:399–429  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

397}
398//助力好友
399async function doHelp() {
400 for (let plantUuid of newShareCodes) {
401 console.log(`开始助力京东账号${$.index} - ${$.nickName}的好友: ${plantUuid}`);
402 if (!plantUuid) continue;
403 if (plantUuid === $.myPlantUuid) {
404 console.log(`\n跳过自己的plantUuid\n`)
405 continue
406 }
407 await helpShare(plantUuid);
408 if ($.helpResult && $.helpResult.code === '0') {
409 // console.log(`助力好友结果: ${JSON.stringify($.helpResult.data.helpShareRes)}`);
410 if ($.helpResult.data.helpShareRes) {
411 if ($.helpResult.data.helpShareRes.state === '1') {
412 console.log(`助力好友${plantUuid}成功`)
413 console.log(`${$.helpResult.data.helpShareRes.promptText}\n`);
414 } else if ($.helpResult.data.helpShareRes.state === '2') {
415 console.log('您今日助力的机会已耗尽,已不能再帮助好友助力了\n');
416 break;
417 } else if ($.helpResult.data.helpShareRes.state === '3') {
418 console.log('该好友今日已满9人助力/20瓶营养液,明天再来为Ta助力吧\n')
419 } else if ($.helpResult.data.helpShareRes.state === '4') {
420 console.log(`${$.helpResult.data.helpShareRes.promptText}\n`)
421 } else {
422 console.log(`助力其他情况:${JSON.stringify($.helpResult.data.helpShareRes)}`);
423 }
424 }
425 } else {
426 console.log(`助力好友失败: ${JSON.stringify($.helpResult)}`);
427 }
428 }
429}
430function showMsg() {
431 $.log(`\n${message}\n`);
432 jdNotify = $.getdata('jdPlantBeanNotify') ? $.getdata('jdPlantBeanNotify') : jdNotify;

Callers 1

jdPlantBeanFunction · 0.70

Calls 2

helpShareFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected