From c82f3e9cb762ba4e18798172c55ed6ca5b3bfc2f Mon Sep 17 00:00:00 2001 From: Jerrypluay Date: Tue, 25 Nov 2025 12:55:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20feat(config):=20enable=20auto-up?= =?UTF-8?q?date=20option=20for=20the=20crystelf-plugin=20in=20the=20config?= =?UTF-8?q?uration=20file.=20=F0=9F=8E=89=20feat(index):=20implement=20aut?= =?UTF-8?q?omatic=20update=20checks=20based=20on=20the=20config=20setting?= =?UTF-8?q?=20in=20the=20plugin=20initialization.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ config/config.json | 2 ++ index.js | 14 ++++++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 290c392..f3e6be9 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ - [X] 自定义上下文长度 - [X] 记忆存储及搜索 - [X] 自定义会话管理 +- [X] 支持获取引用消息,使用seq标记 - [ ] 支持调用更多工具 - [ ] 获取引用消息 - [ ] 适配多模态模型,查看图片等 @@ -129,6 +130,8 @@ { "maxFeed": 10,//使用rss推送功能时,本地记录的最长长度,用于检测最新文章 //功能是否启用 + "?autoUpdate": "是否自动更新插件", + "autoUpdate": true, "poke": true, "60s": true, "fanqie": true, diff --git a/config/config.json b/config/config.json index 1e8239e..ebbe6ab 100644 --- a/config/config.json +++ b/config/config.json @@ -4,6 +4,8 @@ "core": true, "?maxFeed": "最长订阅", "maxFeed": 10, + "?autoUpdate": "是否自动更新插件", + "autoUpdate": true, "poke": true, "60s": true, "fanqie": true, diff --git a/index.js b/index.js index 997b8bd..b96cf69 100644 --- a/index.js +++ b/index.js @@ -9,12 +9,18 @@ logger.info( chalk.rgb(134, 142, 204)(`crystelf-plugin ${Version.ver} 初始化~ by ${Version.author}`) ); -updater.checkAndUpdate().catch((err) => { - logger.error(err); -}); - await crystelfInit.CSH().then(logger.mark('[crystelf-plugin] crystelf-plugin 完成初始化')); +import ConfigControl from "./lib/config/configControl.js"; +const appConfig = await ConfigControl.get('config'); + +if(appConfig.autoUpdate) { + logger.info('[crystelf-plugin] 自动更新已启用,正在自动检查更新..'); + updater.checkAndUpdate().catch((err) => { + logger.error(err); + }); +} + const appPath = Path.apps; const jsFiles = await fc.readDirRecursive(appPath, 'js');