mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
feat: card
This commit is contained in:
parent
cd0793655d
commit
ce3c509cd9
43 changed files with 508 additions and 7 deletions
|
|
@ -21,8 +21,8 @@ export class Card extends ZZZPlugin {
|
|||
}
|
||||
async card() {
|
||||
const { api, deviceFp } = await this.getAPI();
|
||||
const userData = await this.getPlayerInfo();
|
||||
if (!userData) return false;
|
||||
if (!api) return false;
|
||||
await this.getPlayerInfo();
|
||||
let indexData = await api.getData('zzzIndex', { deviceFp });
|
||||
indexData = await api.checkCode(this.e, indexData, 'zzzIndex', {});
|
||||
if (!indexData || indexData.retcode !== 0) {
|
||||
|
|
@ -32,6 +32,7 @@ export class Card extends ZZZPlugin {
|
|||
indexData = indexData.data;
|
||||
indexData = new ZZZIndexResp(indexData);
|
||||
this.e.playerCard.player.region_name = indexData.stats.world_level_name;
|
||||
await indexData.get_assets();
|
||||
const data = {
|
||||
card: indexData,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -71,13 +71,14 @@ export class GachaLog extends ZZZPlugin {
|
|||
this.getLog(key);
|
||||
}
|
||||
async getLog(key) {
|
||||
const uid = await this.getUID();
|
||||
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();
|
||||
this.reply('正在更新抽卡记录,可能需要一段时间,请耐心等待');
|
||||
const data = await updateGachaLog(key, uid);
|
||||
let msg = `抽卡记录更新成功,共${Object.keys(data).length}个卡池`;
|
||||
for (const name in data) {
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ export class Note extends ZZZPlugin {
|
|||
}
|
||||
async note() {
|
||||
const { api, deviceFp } = await this.getAPI();
|
||||
const userData = await this.getPlayerInfo();
|
||||
if (!userData) return false;
|
||||
if (!api) return false;
|
||||
await this.getPlayerInfo();
|
||||
let noteData = await api.getData('zzzNote', { deviceFp });
|
||||
noteData = await api.checkCode(this.e, noteData, 'zzzNote', {});
|
||||
if (!noteData || noteData.retcode !== 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue