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

Function readShareCode

jd_crazy_joy.js:582–605  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

580 }
581}
582function readShareCode() {
583 console.log(`开始`)
584 return new Promise(async resolve => {
585 $.get({url: `https://code.chiang.fun/api/v1/jd/jdcrazyjoy/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => {
586 try {
587 if (err) {
588 console.log(`${JSON.stringify(err)}`)
589 console.log(`${$.name} API请求失败,请检查网路重试`)
590 } else {
591 if (data) {
592 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
593 data = JSON.parse(data);
594 }
595 }
596 } catch (e) {
597 $.logErr(e, resp)
598 } finally {
599 resolve(data);
600 }
601 })
602 await $.wait(10000);
603 resolve()
604 })
605}
606//格式化助力码
607function shareCodesFormat() {
608 return new Promise(async resolve => {

Callers 1

shareCodesFormatFunction · 0.70

Calls 4

logMethod · 0.45
getMethod · 0.45
logErrMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected