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

Function JoinTuan

jd_dreamFactory.js:1090–1120  ·  view source on GitHub ↗
(tuanId, stk = '_time,activeId,tuanId')

Source from the content-addressed store, hash-verified

1088}
1089
1090function JoinTuan(tuanId, stk = '_time,activeId,tuanId') {
1091 return new Promise((resolve) => {
1092 const body = `activeId=${escape(tuanActiveId)}&tuanId=${escape(tuanId)}`;
1093 const options = taskTuanUrl(`JoinTuan`, body, '_time,activeId,tuanId')
1094 $.get(options, async (err, resp, data) => {
1095 try {
1096 if (err) {
1097 console.log(`${JSON.stringify(err)}`)
1098 console.log(`${$.name} API请求失败,请检查网路重试`);
1099 } else {
1100 if (safeGet(data)) {
1101 data = JSON.parse(data);
1102 if (data['ret'] === 0) {
1103 console.log(`参团成功:${JSON.stringify(data)}\n`);
1104 } else if (data['ret'] === 10005 || data['ret'] === 10206) {
1105 //火爆,或者今日参团机会已耗尽
1106 console.log(`参团失败:${JSON.stringify(data)}\n`);
1107 $.canHelp = false;
1108 } else {
1109 console.log(`参团失败:${JSON.stringify(data)}\n`);
1110 }
1111 }
1112 }
1113 } catch (e) {
1114 $.logErr(e, resp)
1115 } finally {
1116 resolve();
1117 }
1118 })
1119 })
1120}
1121//查询所有的团情况(自己开团以及参加别人的团)
1122function QueryAllTuan() {
1123 return new Promise((resolve) => {

Callers 2

jd_dreamFactory.jsFile · 0.85
joinLeaderTuanFunction · 0.85

Calls 5

taskTuanUrlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected