mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 08:09:19 +00:00
🐞 fix: 修复帮助界面缓存问题
This commit is contained in:
parent
c89cf27fa6
commit
1799a82dbd
25
apps/help.js
25
apps/help.js
@ -20,22 +20,27 @@ export class help extends plugin {
|
|||||||
|
|
||||||
async help() {
|
async help() {
|
||||||
let data = await Help.get(this.e);
|
let data = await Help.get(this.e);
|
||||||
if (!data) return;
|
if (!data) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let img = await this.cache(data);
|
let img = await this.cache(data);
|
||||||
await this.reply(img);
|
await this.reply(img);
|
||||||
}
|
}
|
||||||
|
|
||||||
async cache(data) {
|
async cache(data) {
|
||||||
let helpData = {
|
let tmp = md5(JSON.stringify(data));
|
||||||
|
if (help.helpData.md5 === tmp) {
|
||||||
|
return help.helpData.img;
|
||||||
|
}
|
||||||
|
|
||||||
|
help.helpData.img = await puppeteer.screenshot("help", data);
|
||||||
|
help.helpData.md5 = tmp;
|
||||||
|
|
||||||
|
return help.helpData.img;
|
||||||
|
}
|
||||||
|
|
||||||
|
static helpData = {
|
||||||
md5: "",
|
md5: "",
|
||||||
img: "",
|
img: "",
|
||||||
};
|
};
|
||||||
let tmp = md5(JSON.stringify(data));
|
|
||||||
if (helpData.md5 === tmp) return helpData.img;
|
|
||||||
|
|
||||||
helpData.img = await puppeteer.screenshot("help", data);
|
|
||||||
helpData.md5 = tmp;
|
|
||||||
|
|
||||||
return helpData.img;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user