diff --git a/apps/help.js b/apps/help.js index 5a49311..74df78c 100644 --- a/apps/help.js +++ b/apps/help.js @@ -332,18 +332,18 @@ export class Help extends ZZZPlugin { commands: ['设置默认设备'], }, { - title: '开启/关闭自动更新推送', - desc: '开启/关闭自动更新推送,自动更新仅推送给第一个主人', + title: '开启/关闭更新推送', + desc: '开启/关闭更新推送,更新仅推送给第一个主人', needCK: false, needSK: false, - commands: ['开启/关闭自动更新'], + commands: ['开启/关闭更新推送'], }, { - title: '设置自动更新时间', - desc: '设置自动更新时间,cron表达式,如0 0/10 * * * ?', + title: '设置检查自动更新时间', + desc: '设置检查自动更新时间,cron表达式,如0 0/10 * * * ?', needCK: false, needSK: false, - commands: ['设置自动更新时间+cron表达式'], + commands: ['设置检查更新时间+cron表达式'], }, ], }, diff --git a/apps/manage.js b/apps/manage.js index 9527064..b348a8c 100644 --- a/apps/manage.js +++ b/apps/manage.js @@ -77,11 +77,11 @@ export class Panel extends ZZZPlugin { fnc: 'setDefaultDevice', }, { - reg: `${rulePrefix}(开启|关闭)自动更新$`, + reg: `${rulePrefix}(开启|关闭)更新推送$`, fnc: 'enableAutoUpdatePush', }, { - reg: `${rulePrefix}设置自动更新时间(.+)$`, + reg: `${rulePrefix}设置检查更新时间(.+)$`, fnc: 'setCheckUpdateCron', }, ], diff --git a/apps/update.js b/apps/update.js index 8fa2be0..590a67e 100644 --- a/apps/update.js +++ b/apps/update.js @@ -5,7 +5,9 @@ import { ZZZUpdate } from '../lib/update.js'; import config from '../../../lib/config/config.js'; import { rulePrefix } from '../lib/common.js'; -const lastNotify = ''; +const updateInfo = { + lastCheckCommit: '', +}; export class update extends plugin { constructor() { super({ @@ -41,13 +43,13 @@ export class update extends plugin { async checkUpdateTask() { const updateConfig = _.get(settings.getConfig('config'), 'update', {}); - const enable = _.get(updateConfig, 'autoCheck', true); + const enable = _.get(updateConfig, 'autoCheck', false); if (!enable) return; if (!ZZZUpdate) return false; const up = new ZZZUpdate(); const result = await up.hasUpdate(); if (result.hasUpdate) { - if (result.logs[0].commit === lastNotify) return; + if (result.logs[0].commit === updateInfo.lastCheckCommit) return; const botInfo = { nickname: 'ZZZ-Plugin更新', user_id: Bot.uin }; const msgs = [ { @@ -77,7 +79,7 @@ export class update extends plugin { await Bot.pickFriend(master).sendMsg(msg); break; } - lastNotify = result.logs[0].commit; + updateInfo.lastCheckCommit = result.logs[0].commit; } } }