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

Function lottery

jd_xtg.js:420–445  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

418 });
419}
420function lottery(id) {
421 return new Promise(async (resolve) => {
422 const options = taskPostUrl('task/lottery', 'lottery', `starId=${$.activeId}&id=${id}`);
423 $.post(options, (err, resp, data) => {
424 try {
425 if (err) {
426 console.log(`${JSON.stringify(err)}`);
427 console.log(`${$.name} API请求失败,请检查网路重试`);
428 } else {
429 data = JSON.parse(data);
430 if (data && data.code === 200) {
431 if (data.data && data.data.status === 1) {
432 console.log(`京东账号${$.index} ${$.nickName || $.UserName}恭喜中奖\n【${$.activeId}】星推官抽奖详情${JSON.stringify(data)}\n`);
433 } else {
434 console.log(`【${$.activeId}】星推官抽奖:未中奖\n`)
435 }
436 }
437 }
438 } catch (e) {
439 $.logErr(e, resp);
440 } finally {
441 resolve();
442 }
443 });
444 });
445}
446function TotalBean() {
447 return new Promise(async (resolve) => {
448 const options = {

Callers 1

indexInfoFunction · 0.70

Calls 4

taskPostUrlFunction · 0.70
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected