mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
fix: 重复提醒
This commit is contained in:
parent
108cc5399b
commit
66e026ccc1
1 changed files with 3 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import { ZZZUpdate } from '../lib/update.js';
|
|||
import config from '../../../lib/config/config.js';
|
||||
import { rulePrefix } from '../lib/common.js';
|
||||
|
||||
const lastNotify = '';
|
||||
export class update extends plugin {
|
||||
constructor() {
|
||||
super({
|
||||
|
|
@ -46,6 +47,7 @@ export class update extends plugin {
|
|||
const up = new ZZZUpdate();
|
||||
const result = await up.hasUpdate();
|
||||
if (result.hasUpdate) {
|
||||
if (result.logs[0].commit === lastNotify) return;
|
||||
const botInfo = { nickname: 'ZZZ-Plugin更新', user_id: Bot.uin };
|
||||
const msgs = [
|
||||
{
|
||||
|
|
@ -75,6 +77,7 @@ export class update extends plugin {
|
|||
await Bot.pickFriend(master).sendMsg(msg);
|
||||
break;
|
||||
}
|
||||
lastNotify = result.logs[0].commit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue