card basic

This commit is contained in:
bietiaop 2024-07-09 01:22:14 +08:00
parent 51fb65cdb4
commit cd0793655d
32 changed files with 807 additions and 260 deletions

View file

@ -71,6 +71,12 @@ export class GachaLog extends ZZZPlugin {
this.getLog(key);
}
async getLog(key) {
const lastQueryTime = await redis.get(`ZZZ:GACHA:${uid}:LASTTIME`);
if (lastQueryTime && Date.now() - lastQueryTime < 1000 * 60 * 5) {
await this.reply('1分钟内只能刷新一次请稍后重试');
return false;
}
await redis.set(`ZZZ:GACHA:${uid}:LASTTIME`, Date.now());
const uid = await this.getUID();
const data = await updateGachaLog(key, uid);
let msg = `抽卡记录更新成功,共${Object.keys(data).length}个卡池`;