chore: 提前更新dyid

This commit is contained in:
shanmite 2021-02-13 13:13:25 +08:00
parent 49949f1dfc
commit 0c9876a92a
2 changed files with 7 additions and 2 deletions

View File

@ -394,7 +394,7 @@ const BiliAPI = {
});
},
/**
* 转发前查看是否重复转发
* 转发前查看是否重复转发
* 自动转发
* @param {Number} uid
* 自己的UID

View File

@ -58,6 +58,12 @@ class Monitor extends Public {
eventBus.emit('Turn_on_the_Monitor');
return false;
} else {
let dyids = [];
allLottery.forEach(lottery => {
let dyid = lottery.dyid;
if (typeof dyid === 'string') dyids.push(dyid);
})
MyStorage.updateDyid((Array.from(new Set([...dyids, ...this.AllMyLotteryInfo.split(',')]))).toString())
for (const Lottery of allLottery) {
const a = await this.go(Lottery);
if (a === 0) return;
@ -203,7 +209,6 @@ class Monitor extends Public {
}
if (this.isAttentionErr && uid.length !== 0) return 0;
if (await BiliAPI.autoRelay(GlobalVar.myUID, dyid, relay_chat, ctrl) === 0) return 0;
if (await MyStorage.updateDyid((Array.from(new Set([dyid, ...this.AllMyLotteryInfo.split(',')]))).toString()) === -1) return 0;
if (await BiliAPI.autolike(dyid) === 0) return 0;
await Base.delay(Number(config.wait) + Math.floor(Math.random() * 60000 - 30000));
}