MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / claimDailyTask

Method claimDailyTask

wxapp/niuniuduanju.js:294–311  ·  view source on GitHub ↗
(task)

Source from the content-addressed store, hash-verified

292 }
293
294 async claimDailyTask(task) {
295 try {
296 const result = await this.request({ apiPath: task.apiPath, params: task.params || {} });
297 $.log(`账号[${this.index}] ${task.name}: ${result.msg || "已领取"}${result.data !== undefined ? ` ${result.data}` : ""}`);
298 } catch (e) {
299 const message = String(e.message || e);
300 if (/已领取|已完成|今日.*完成|重复|不能重复|已经.*领取/.test(message)) {
301 $.log(`账号[${this.index}] ${task.name}: 今日已完成`);
302 return;
303 }
304 if (/未完成|请先|任务未达成|次数不足|时间未到|倒计时|稍后|观看/.test(message)) {
305 $.log(`账号[${this.index}] ${task.name}: ${message}`);
306 return;
307 }
308 $.log(`账号[${this.index}] ${task.name}失败: ${message}`);
309 if (e.code === 401 || /token|登录|验证失败/.test(message)) this.removeCachedToken();
310 }
311 }
312
313 async completeEatGoldTasks() {
314 try {

Callers 1

doDailyTasksMethod · 0.95

Calls 3

requestMethod · 0.95
removeCachedTokenMethod · 0.95
logMethod · 0.45

Tested by

no test coverage detected