mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 05:07:46 +00:00
feat:国际服更新抽卡记录
This commit is contained in:
parent
b0f887c8f0
commit
cd5ad2457a
4 changed files with 113 additions and 38 deletions
|
|
@ -124,7 +124,19 @@ export class GachaLog extends ZZZPlugin {
|
|||
async refreshGachaLog() {
|
||||
const uid = await this.getUID();
|
||||
if (/^(1[0-9])[0-9]{8}/i.test(uid)) {
|
||||
return this.reply('国际服不支持此功能');
|
||||
const { api } = await this.getAPI();
|
||||
this.reply('抽卡记录获取中请稍等...可能需要一段时间,请耐心等待');
|
||||
const { data, count } = await updateGachaLog(api, uid);
|
||||
let msg = [];
|
||||
msg.push(`抽卡记录更新成功,共${Object.keys(data).length}个卡池`);
|
||||
for (const name in data) {
|
||||
msg.push(
|
||||
`${name}新增${count[name] || 0}条记录,一共${data[name].length}条记录`
|
||||
);
|
||||
}
|
||||
return this.reply(
|
||||
await common.makeForwardMsg(this.e, msg.join('\n'), '抽卡记录更新成功')
|
||||
);
|
||||
}
|
||||
if (!uid) return false;
|
||||
const lastQueryTime = await redis.get(`ZZZ:GACHA:${uid}:LASTTIME`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue