From 772359422d6f5c674e0c5b8e5283ee438549ed31 Mon Sep 17 00:00:00 2001 From: Hex Date: Sat, 5 Aug 2023 14:03:15 +0800 Subject: [PATCH] Update smzdm_lottery.js --- smzdm_lottery.js | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/smzdm_lottery.js b/smzdm_lottery.js index 17e368c..9f86a34 100644 --- a/smzdm_lottery.js +++ b/smzdm_lottery.js @@ -21,27 +21,36 @@ class SmzdmLotteryBot extends SmzdmBot { async run() { let notifyMsg = ''; - const lifeId = await this.getActivityIdFromLife(); + // const lifeId = await this.getActivityIdFromLife(); - if (lifeId) { + // if (lifeId) { + // await wait(3, 10); + + // notifyMsg += `转盘抽奖ID: ${lifeId}\n`; + // notifyMsg += await this.draw(lifeId); + // notifyMsg += '\n\n'; + // } + + const vipId1 = await this.getActivityIdFromVip('https://m.smzdm.com/topic/bwrzf5/516lft'); + + if (vipId1) { await wait(3, 10); - notifyMsg += `转盘抽奖ID: ${lifeId}\n`; - notifyMsg += await this.draw(lifeId); - notifyMsg += '\n\n'; + notifyMsg += `转盘抽奖ID: ${vipId1}\n`; + notifyMsg += await this.draw(vipId1); } $.log(); await wait(5, 15); $.log(); - const vipId = await this.getActivityIdFromVip(); + const vipId2 = await this.getActivityIdFromVip('https://m.smzdm.com/topic/zhyzhuanpan/cjzp/'); - if (vipId) { + if (vipId2) { await wait(3, 10); - notifyMsg += `转盘抽奖ID: ${vipId}\n`; - notifyMsg += await this.draw(vipId); + notifyMsg += `转盘抽奖ID: ${vipId2}\n`; + notifyMsg += await this.draw(vipId2); } return notifyMsg; @@ -125,8 +134,8 @@ class SmzdmLotteryBot extends SmzdmBot { } // 获取会员中心转盘抽奖ID - async getActivityIdFromVip() { - const { isSuccess, data, response } = await requestApi('https://m.smzdm.com/topic/zhyzhuanpan/cjzp/', { + async getActivityIdFromVip(url) { + const { isSuccess, data, response } = await requestApi(url, { sign: false, parseJSON: false, headers: {