mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
feat: gacha
This commit is contained in:
parent
e28fbd8472
commit
af3b551a6a
33 changed files with 579 additions and 15 deletions
|
|
@ -1,10 +1,9 @@
|
|||
import { ZZZPlugin } from '../lib/plugin.js';
|
||||
import _ from 'lodash';
|
||||
import render from '../lib/render.js';
|
||||
import { ZZZNoteResp } from '../model/note.js';
|
||||
import { rulePrefix } from '../lib/common.js';
|
||||
import { getAuthKey, getStoken } from '../lib/authkey.js';
|
||||
import { updateGachaLog } from '../lib/gacha.js';
|
||||
import { getAuthKey } from '../lib/authkey.js';
|
||||
import { anaylizeGachaLog, updateGachaLog } from '../lib/gacha.js';
|
||||
|
||||
export class GachaLog extends ZZZPlugin {
|
||||
constructor() {
|
||||
|
|
@ -26,6 +25,10 @@ export class GachaLog extends ZZZPlugin {
|
|||
reg: `^${rulePrefix}抽卡帮助$`,
|
||||
fnc: 'gachaHelp',
|
||||
},
|
||||
{
|
||||
reg: `^${rulePrefix}抽卡分析$`,
|
||||
fnc: 'gachaLogAnalysis',
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
|
@ -87,4 +90,21 @@ export class GachaLog extends ZZZPlugin {
|
|||
await this.reply(msg);
|
||||
return false;
|
||||
}
|
||||
|
||||
async gachaLogAnalysis() {
|
||||
const uid = await this.getUID();
|
||||
if (!uid) {
|
||||
return false;
|
||||
}
|
||||
await this.getPlayerInfo();
|
||||
const data = await anaylizeGachaLog(uid);
|
||||
if (!data) {
|
||||
await this.reply('未查询到抽卡记录,请先发送抽卡链接');
|
||||
return false;
|
||||
}
|
||||
const result = {
|
||||
data,
|
||||
};
|
||||
await render(this.e, 'gachalog/index.html', result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue