feat: 查询其他人&设置允许/禁止查询其他人

This commit is contained in:
bietiaop 2024-07-15 12:44:29 +08:00
parent 8981fa84e9
commit 606109f4b3
7 changed files with 29 additions and 17 deletions

View file

@ -31,7 +31,8 @@ export class Panel extends ZZZPlugin {
const uid = await this.getUID();
if (!uid) return;
const lastQueryTime = await redis.get(`ZZZ:PANEL:${uid}:LASTTIME`);
const coldTime = settings.getConfig('panel').interval || 300;
const panelSettings = settings.getConfig('panel');
const coldTime = _.get(panelSettings, 'interval', 300);
if (lastQueryTime && Date.now() - lastQueryTime < 1000 * coldTime) {
await this.reply(`${coldTime}秒内只能刷新一次,请稍后再试`);
return;