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

Function helpFriend

activity/jd_global.js:249–281  ·  view source on GitHub ↗
(inviterPin)

Source from the content-addressed store, hash-verified

247}
248
249async function helpFriend(inviterPin) {
250 return new Promise(resolve => {
251 $.get(taskUrl("inviteHelp", {
252 "inviterPin": inviterPin,
253 "taskId": "51",
254 "pageType": "doHelp",
255 "headImg": "",
256 "username": "",
257 "activityCode": actCode
258 }), async (err, resp, data) => {
259 try {
260 if (err) {
261 console.log(`${JSON.stringify(err)}`)
262 console.log(`${$.name} API请求失败,请检查网路重试`)
263 } else {
264 if (safeGet(data)) {
265 data = JSON.parse(data);
266 if (data['code'] === '0') {
267 console.log(data['result']['message'])
268 if(data['result']['message']==='您今天的助力次数已达上限,明天再试试吧~') $.canHelp = false
269 } else {
270 console.log(JSON.stringify(data))
271 }
272 }
273 }
274 } catch (e) {
275 $.logErr(e, resp)
276 } finally {
277 resolve(data);
278 }
279 })
280 })
281}
282
283async function receiveReward(body) {
284 return new Promise(resolve => {

Callers 1

helpFriendsFunction · 0.70

Calls 5

taskUrlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected