node-karin 1.8.9 → 1.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +95 -0
- package/dist/index.d.ts +15 -6
- package/dist/index.mjs +64 -54
- package/dist/web/assets/js/components-9RKTV4LX.js.br +0 -0
- package/dist/web/assets/js/entry-CzDSdA4M.js.br +0 -0
- package/dist/web/assets/js/hooks-D65eaS4p.js.br +0 -0
- package/dist/web/assets/js/page-404.tsx-BNti6Z2J.js +1 -0
- package/dist/web/assets/js/page-dashboard-BewrlGFW.js.br +0 -0
- package/dist/web/assets/js/page-loading.tsx-CJaYj8cR.js.br +0 -0
- package/dist/web/assets/js/page-login.tsx-DkO-XzeU.js.br +0 -0
- package/dist/web/assets/js/{utils-DSlRvNHw.js → utils-DqFE1yN-.js} +1 -1
- package/dist/web/assets/js/vendor-heroui-WfpTlnyv.js.br +0 -0
- package/dist/web/assets/js/vendor-others-B6NXaB-r.js.br +0 -0
- package/dist/web/assets/js/vendor-react-Hg1DVPZt.js.br +0 -0
- package/dist/web/assets/js/vendor-visual-mzxhMYK3.js.br +0 -0
- package/dist/web/index.html +9 -9
- package/package.json +2 -2
- package/dist/web/assets/js/components-D6OCw7kO.js.br +0 -0
- package/dist/web/assets/js/entry-BP2jjfVR.js.br +0 -0
- package/dist/web/assets/js/hooks-BoS7DPVe.js.br +0 -0
- package/dist/web/assets/js/page-404.tsx-BVlJR0f3.js +0 -1
- package/dist/web/assets/js/page-dashboard-BX_VXjx6.js.br +0 -0
- package/dist/web/assets/js/page-loading.tsx-Cz1_t9kn.js.br +0 -0
- package/dist/web/assets/js/page-login.tsx-hUBVA6ws.js.br +0 -0
- package/dist/web/assets/js/vendor-heroui-96DnnqOT.js.br +0 -0
- package/dist/web/assets/js/vendor-others-D7Rwl1O6.js.br +0 -0
- package/dist/web/assets/js/vendor-react-BDRVXu1f.js.br +0 -0
- package/dist/web/assets/js/vendor-visual-BMhnpZxY.js.br +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [1.8.11](https://github.com/KarinJS/Karin/compare/core-v1.8.10...core-v1.8.11) (2025-05-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🐛 Bug Fixes
|
|
7
|
+
|
|
8
|
+
* 修复群消息下会话条件判断错误问题 ([#411](https://github.com/KarinJS/Karin/issues/411)) ([49d3b49](https://github.com/KarinJS/Karin/commit/49d3b498d8a5ae6d0f9f71b9b794ddbc148c3629))
|
|
9
|
+
|
|
10
|
+
## [1.8.10](https://github.com/KarinJS/Karin/compare/core-v1.8.9...core-v1.8.10) (2025-05-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### 🐛 Bug Fixes
|
|
14
|
+
|
|
15
|
+
* close [#408](https://github.com/KarinJS/Karin/issues/408) ([#409](https://github.com/KarinJS/Karin/issues/409)) ([8c78b4a](https://github.com/KarinJS/Karin/commit/8c78b4a753a791248ab752e2a8426ff82eb467d5))
|
|
16
|
+
|
|
17
|
+
## [1.8.9](https://github.com/KarinJS/Karin/compare/core-v1.8.8...core-v1.8.9) (2025-05-07)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### 🐛 Bug Fixes
|
|
21
|
+
|
|
22
|
+
* 修复`web-config`读取的是缓存 ([#405](https://github.com/KarinJS/Karin/issues/405)) ([3335cef](https://github.com/KarinJS/Karin/commit/3335cefc70b811e11084f4cee1a87c8602ae6838))
|
|
23
|
+
|
|
3
24
|
## [1.8.8](https://github.com/KarinJS/Karin/compare/core-v1.8.7...core-v1.8.8) (2025-05-07)
|
|
4
25
|
|
|
5
26
|
|
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
## 项目介绍
|
|
4
|
+
|
|
5
|
+
`karin`(卡琳)是一款灵活、现代、极易扩展的 Node.js 插件化应用框架,专为开发者打造,助你轻松构建属于自己的高效工具链和自动化服务。
|
|
6
|
+
|
|
7
|
+
✨ **主要特性**:
|
|
8
|
+
- 插件化架构,支持热插拔,生态丰富
|
|
9
|
+
- 一行命令即可初始化项目,快速上手
|
|
10
|
+
- 丰富的 Web UI(基于 React + HeroUI),颜值与功能并存
|
|
11
|
+
- 支持多种自动化场景、任务调度、依赖管理
|
|
12
|
+
- 轻松集成第三方服务,打造属于你的"数字助理"
|
|
13
|
+
- 社区活跃,持续更新,文档完善
|
|
14
|
+
|
|
15
|
+
> 🦄 让开发变得像魔法一样有趣!
|
|
16
|
+
|
|
17
|
+
## 🚀 稳定长期维护
|
|
18
|
+
|
|
19
|
+
自 `1.8.0` 版本起,Karin 已进入**稳定长期维护阶段**。我们承诺持续修复 bug、优化体验,并欢迎社区力量共同完善生态。
|
|
20
|
+
|
|
21
|
+
## 快速开始
|
|
22
|
+
|
|
23
|
+
[📚 查看最新文档](https://karin.fun/)
|
|
24
|
+
|
|
25
|
+
一键初始化:`pnpm create karin`
|
|
26
|
+
|
|
27
|
+
> 当前文档可能存在滞后性,欢迎加入交流群(967068507)一起玩耍、提建议!
|
|
28
|
+
|
|
29
|
+
## 温馨提示
|
|
30
|
+
|
|
31
|
+
> Karin 现已稳定,放心食用!遇到问题欢迎提 Issue 或加群讨论,我们会持续优化。
|
|
32
|
+
|
|
33
|
+
## 文档站说明
|
|
34
|
+
|
|
35
|
+
我们提供多个文档站点供您访问,解决可能出现的访问困难:
|
|
36
|
+
|
|
37
|
+
- **主文档站**: [https://karin.fun](https://karin.fun) (基于 GitHub Pages)
|
|
38
|
+
- **镜像站点**:
|
|
39
|
+
- 憨憨镜像: [https://karin.hanhanz.top](https://karin.hanhanz.top) (**推荐访问**)
|
|
40
|
+
- Vercel 镜像: [https://docs.karin.fun](https://docs.karin.fun) (**推荐访问**)
|
|
41
|
+
- Deno 镜像: [https://karin.deno.dev](https://karin.deno.dev) (**推荐访问**)
|
|
42
|
+
|
|
43
|
+
> 💡 主文档站托管在 GitHub 上,如访问不畅,推荐使用 Deno 镜像站
|
|
44
|
+
|
|
45
|
+
## 鸣谢
|
|
46
|
+
|
|
47
|
+
- webui: [bietiaop](https://github.com/bietiaop)
|
|
48
|
+
- docs: [ikenxuan](https://github.com/ikenxuan)
|
|
49
|
+
- name: [fuqiuluo](https://github.com/fuqiuluo)
|
|
50
|
+
|
|
51
|
+
> 🧙♂️ 感谢三位大佬的魔法加持!
|
|
52
|
+
|
|
53
|
+
### 贡献者
|
|
54
|
+
|
|
55
|
+
> 🌟 星光闪烁,你们的智慧如同璀璨的夜空。感谢所有为 **Karin** 做出贡献的人!
|
|
56
|
+
|
|
57
|
+
[](https://github.com/KarinJS/Karin/graphs/contributors)
|
|
58
|
+
|
|
59
|
+

|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
🎉 **加入我们,让 Karin 成为你开发路上的贴心伙伴!**
|
|
64
|
+
|
|
65
|
+
## 常见问题
|
|
66
|
+
|
|
67
|
+
- 文档没看懂?[点我提问](https://github.com/KarinJS/Karin/issues) 或加群 967068507
|
|
68
|
+
- 插件不会写?欢迎参考[插件开发文档](https://karin.fun/plugins/)
|
|
69
|
+
- 遇到 bug?大胆提 Issue,我们超快响应!
|
|
70
|
+
|
|
71
|
+
## 如何参与贡献(PR)
|
|
72
|
+
|
|
73
|
+
1. Fork 本仓库,创建你的分支
|
|
74
|
+
2. 提交你的更改,附上简要说明
|
|
75
|
+
3. 发起 Pull Request,耐心等待 Review
|
|
76
|
+
4. 你的名字将出现在贡献者列表,收获一份开源荣誉!
|
|
77
|
+
|
|
78
|
+
> 💡 欢迎任何形式的贡献,无论是代码、文档、建议还是灵感!
|
|
79
|
+
|
|
80
|
+
## Issue 指南
|
|
81
|
+
|
|
82
|
+
- 提交前请先搜索是否有类似问题
|
|
83
|
+
- 尽量提供详细的复现步骤、环境信息和截图
|
|
84
|
+
- 标题简明扼要,正文描述清晰
|
|
85
|
+
- 遇到安全相关问题请私信维护者
|
|
86
|
+
|
|
87
|
+
## 开源协议
|
|
88
|
+
|
|
89
|
+
本项目基于 [MIT License](./LICENSE) 开源,欢迎自由使用、修改和分发。
|
|
90
|
+
|
|
91
|
+
> 📢 记得给个 Star 支持我们,你的支持是我们最大的动力!
|
|
92
|
+
|
|
93
|
+
## 更新日志
|
|
94
|
+
|
|
95
|
+
我们定期发布更新,查看 [CHANGELOG](https://github.com/KarinJS/Karin/releases) 了解最新变化。
|
package/dist/index.d.ts
CHANGED
|
@@ -12170,10 +12170,6 @@ declare const timeout: () => number;
|
|
|
12170
12170
|
*/
|
|
12171
12171
|
declare const webSocketServerToken: () => string;
|
|
12172
12172
|
|
|
12173
|
-
/**
|
|
12174
|
-
* 读取config.json 不走缓存
|
|
12175
|
-
*/
|
|
12176
|
-
declare const readConfig: (dir: string) => Config;
|
|
12177
12173
|
/**
|
|
12178
12174
|
* @public 公开Api
|
|
12179
12175
|
* @description 获取配置 `config.json`
|
|
@@ -12279,6 +12275,12 @@ declare const getGroupCfg: (groupId: string, selfId: string) => Groups[number];
|
|
|
12279
12275
|
* @param selfId 机器人ID
|
|
12280
12276
|
*/
|
|
12281
12277
|
declare const getGuildCfg: (guildId: string, channelId: string, selfId: string) => Groups[number];
|
|
12278
|
+
/**
|
|
12279
|
+
* @web 获取配置文件 不走缓存
|
|
12280
|
+
* @param dir 配置文件根目录
|
|
12281
|
+
* @returns 配置文件数据
|
|
12282
|
+
*/
|
|
12283
|
+
declare const getGroupsFileData: (dir: string) => Record<string, GroupsObjectValue>;
|
|
12282
12284
|
|
|
12283
12285
|
/**
|
|
12284
12286
|
* @public 公开Api
|
|
@@ -12300,6 +12302,12 @@ declare const getFriendCfg: (userId: string, selfId: string) => PrivatesObjectVa
|
|
|
12300
12302
|
* @param selfId 机器人ID
|
|
12301
12303
|
*/
|
|
12302
12304
|
declare const getDirectCfg: (userId: string, selfId: string) => PrivatesObjectValue;
|
|
12305
|
+
/**
|
|
12306
|
+
* @web 获取配置文件 不走缓存
|
|
12307
|
+
* @param dir 配置文件根目录
|
|
12308
|
+
* @returns 配置文件数据
|
|
12309
|
+
*/
|
|
12310
|
+
declare const getPrivatesFileData: (dir: string) => Record<string, PrivatesObjectValue>;
|
|
12303
12311
|
|
|
12304
12312
|
/**
|
|
12305
12313
|
* @public 公开Api
|
|
@@ -12350,7 +12358,9 @@ declare const index_getDirectCfg: typeof getDirectCfg;
|
|
|
12350
12358
|
declare const index_getEnv: typeof getEnv;
|
|
12351
12359
|
declare const index_getFriendCfg: typeof getFriendCfg;
|
|
12352
12360
|
declare const index_getGroupCfg: typeof getGroupCfg;
|
|
12361
|
+
declare const index_getGroupsFileData: typeof getGroupsFileData;
|
|
12353
12362
|
declare const index_getGuildCfg: typeof getGuildCfg;
|
|
12363
|
+
declare const index_getPrivatesFileData: typeof getPrivatesFileData;
|
|
12354
12364
|
declare const index_getRenderCfg: typeof getRenderCfg;
|
|
12355
12365
|
declare const index_getYaml: typeof getYaml;
|
|
12356
12366
|
declare const index_groups: typeof groups;
|
|
@@ -12363,7 +12373,6 @@ declare const index_pkg: typeof pkg;
|
|
|
12363
12373
|
declare const index_pm2: typeof pm2;
|
|
12364
12374
|
declare const index_port: typeof port;
|
|
12365
12375
|
declare const index_privates: typeof privates;
|
|
12366
|
-
declare const index_readConfig: typeof readConfig;
|
|
12367
12376
|
declare const index_setConfig: typeof setConfig;
|
|
12368
12377
|
declare const index_setEnv: typeof setEnv;
|
|
12369
12378
|
declare const index_setYaml: typeof setYaml;
|
|
@@ -12372,7 +12381,7 @@ declare const index_updateLevel: typeof updateLevel;
|
|
|
12372
12381
|
declare const index_webSocketServerToken: typeof webSocketServerToken;
|
|
12373
12382
|
declare const index_writeEnv: typeof writeEnv;
|
|
12374
12383
|
declare namespace index {
|
|
12375
|
-
export { index_adapter as adapter, index_admin as admin, index_authKey as authKey, index_clearCache as clearCache, index_clearFiles as clearFiles, index_config as config, index_createCount as createCount, index_defaultConfig as defaultConfig, index_env as env, index_ffmpegPath as ffmpegPath, index_ffplayPath as ffplayPath, index_ffprobePath as ffprobePath, index_formatArray as formatArray, index_formatObject as formatObject, index_getCacheCfg as getCacheCfg, index_getDirectCfg as getDirectCfg, index_getEnv as getEnv, index_getFriendCfg as getFriendCfg, index_getGroupCfg as getGroupCfg, index_getGuildCfg as getGuildCfg, index_getRenderCfg as getRenderCfg, index_getYaml as getYaml, index_groups as groups, index_host as host, index_initConfigCache as initConfigCache, index_initPm2 as initPm2, index_master as master, index_mergeDegAndCfg as mergeDegAndCfg, index_pkg as pkg, index_pm2 as pm2, index_port as port, index_privates as privates,
|
|
12384
|
+
export { index_adapter as adapter, index_admin as admin, index_authKey as authKey, index_clearCache as clearCache, index_clearFiles as clearFiles, index_config as config, index_createCount as createCount, index_defaultConfig as defaultConfig, index_env as env, index_ffmpegPath as ffmpegPath, index_ffplayPath as ffplayPath, index_ffprobePath as ffprobePath, index_formatArray as formatArray, index_formatObject as formatObject, index_getCacheCfg as getCacheCfg, index_getDirectCfg as getDirectCfg, index_getEnv as getEnv, index_getFriendCfg as getFriendCfg, index_getGroupCfg as getGroupCfg, index_getGroupsFileData as getGroupsFileData, index_getGuildCfg as getGuildCfg, index_getPrivatesFileData as getPrivatesFileData, index_getRenderCfg as getRenderCfg, index_getYaml as getYaml, index_groups as groups, index_host as host, index_initConfigCache as initConfigCache, index_initPm2 as initPm2, index_master as master, index_mergeDegAndCfg as mergeDegAndCfg, index_pkg as pkg, index_pm2 as pm2, index_port as port, index_privates as privates, redis$1 as redis, render$1 as render, index_setConfig as setConfig, index_setEnv as setEnv, index_setYaml as setYaml, index_timeout as timeout, index_updateLevel as updateLevel, index_webSocketServerToken as webSocketServerToken, index_writeEnv as writeEnv };
|
|
12376
12385
|
}
|
|
12377
12386
|
|
|
12378
12387
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -3219,7 +3219,7 @@ var init_tools = __esm({
|
|
|
3219
3219
|
return {};
|
|
3220
3220
|
};
|
|
3221
3221
|
getCacheCfg = (cache12, count3, keys) => {
|
|
3222
|
-
if (
|
|
3222
|
+
if (keys[0] in cache12) {
|
|
3223
3223
|
if (!count3[keys[0]]) {
|
|
3224
3224
|
count3[keys[0]] = { start: 0, count: 0 };
|
|
3225
3225
|
}
|
|
@@ -3227,12 +3227,12 @@ var init_tools = __esm({
|
|
|
3227
3227
|
return cache12[keys[0]];
|
|
3228
3228
|
}
|
|
3229
3229
|
for (const index6 in keys) {
|
|
3230
|
-
if (
|
|
3230
|
+
if (keys[index6] in cache12) {
|
|
3231
3231
|
if (index6 === "0") {
|
|
3232
3232
|
count3[keys[index6]] = { start: 0, count: 1 };
|
|
3233
3233
|
} else {
|
|
3234
|
-
count3[keys[
|
|
3235
|
-
cache12[keys[
|
|
3234
|
+
count3[keys[0]] = { start: 0, count: 1 };
|
|
3235
|
+
cache12[keys[0]] = cache12[keys[index6]];
|
|
3236
3236
|
}
|
|
3237
3237
|
return cache12[keys[index6]];
|
|
3238
3238
|
}
|
|
@@ -4648,7 +4648,7 @@ var init_handler = __esm({
|
|
|
4648
4648
|
init_lock();
|
|
4649
4649
|
init_internal();
|
|
4650
4650
|
init_common();
|
|
4651
|
-
log2 = (
|
|
4651
|
+
log2 = (logText, text2) => logger.debug(`[\u6D88\u606F\u8FC7\u6EE4]${logText} ${text2}`);
|
|
4652
4652
|
initMsg = (ctx3) => {
|
|
4653
4653
|
const { msg, raw: raw2 } = createRawMessage(ctx3.elements);
|
|
4654
4654
|
ctx3.msg = msg;
|
|
@@ -4719,27 +4719,28 @@ var init_handler = __esm({
|
|
|
4719
4719
|
return true;
|
|
4720
4720
|
};
|
|
4721
4721
|
privateFilterEvent = (ctx3, config3, friend, cd) => {
|
|
4722
|
+
const runLog = (text2) => log2(ctx3.logText, `${text2}: ${ctx3.eventId}`);
|
|
4722
4723
|
if (ctx3.isFriend) {
|
|
4723
4724
|
if (!config3?.friend?.enable) {
|
|
4724
|
-
|
|
4725
|
+
runLog("\u5F53\u524D\u597D\u53CB\u4E8B\u4EF6\u672A\u542F\u7528");
|
|
4725
4726
|
return false;
|
|
4726
4727
|
}
|
|
4727
4728
|
} else {
|
|
4728
4729
|
if (!config3?.directs?.enable) {
|
|
4729
|
-
|
|
4730
|
+
runLog("\u5F53\u524D\u9891\u9053\u79C1\u4FE1\u4E8B\u4EF6\u672A\u542F\u7528");
|
|
4730
4731
|
return false;
|
|
4731
4732
|
}
|
|
4732
4733
|
}
|
|
4733
4734
|
if (!cd) {
|
|
4734
|
-
|
|
4735
|
+
runLog("\u5F53\u524D\u5904\u4E8ECD\u4E2D");
|
|
4735
4736
|
return false;
|
|
4736
4737
|
}
|
|
4737
4738
|
if (config3?.user?.enable_list?.length && !config3?.user?.enable_list.includes(ctx3.userId)) {
|
|
4738
|
-
|
|
4739
|
+
runLog("\u7528\u6237\u672A\u5904\u4E8E\u767D\u540D\u5355");
|
|
4739
4740
|
return false;
|
|
4740
4741
|
}
|
|
4741
4742
|
if (config3?.user?.disable_list?.length && config3?.user?.disable_list.includes(ctx3.userId)) {
|
|
4742
|
-
|
|
4743
|
+
runLog("\u7528\u6237\u5904\u4E8E\u9ED1\u540D\u5355");
|
|
4743
4744
|
return false;
|
|
4744
4745
|
}
|
|
4745
4746
|
if (ctx3.event !== "message") {
|
|
@@ -4749,28 +4750,28 @@ var init_handler = __esm({
|
|
|
4749
4750
|
0: () => true,
|
|
4750
4751
|
2: () => {
|
|
4751
4752
|
if (!ctx3.isAdmin && !ctx3.isMaster) {
|
|
4752
|
-
|
|
4753
|
+
runLog("\u5F53\u524D\u4EC5\u5141\u8BB8\u7BA1\u7406\u5458\u4F7F\u7528");
|
|
4753
4754
|
return false;
|
|
4754
4755
|
}
|
|
4755
4756
|
return true;
|
|
4756
4757
|
},
|
|
4757
4758
|
3: () => {
|
|
4758
4759
|
if (!ctx3.alias) {
|
|
4759
|
-
|
|
4760
|
+
runLog("\u5F53\u524D\u4EC5\u5141\u8BB8Bot\u522B\u540D\u89E6\u53D1\u4F7F\u7528");
|
|
4760
4761
|
return false;
|
|
4761
4762
|
}
|
|
4762
4763
|
return true;
|
|
4763
4764
|
},
|
|
4764
4765
|
5: () => {
|
|
4765
4766
|
if (!ctx3.isAdmin && !ctx3.isMaster && !ctx3.alias && !ctx3.atBot) {
|
|
4766
|
-
|
|
4767
|
+
runLog("\u5F53\u524D\u4EC5\u5141\u8BB8@\u6216\u522B\u540D\u89E6\u53D1(\u7BA1\u7406\u5458\u4F8B\u5916)");
|
|
4767
4768
|
return false;
|
|
4768
4769
|
}
|
|
4769
4770
|
return true;
|
|
4770
4771
|
},
|
|
4771
4772
|
6: () => {
|
|
4772
4773
|
if (!ctx3.isMaster) {
|
|
4773
|
-
|
|
4774
|
+
runLog("\u5F53\u524D\u4EC5\u5141\u8BB8\u4E3B\u4EBA\u4F7F\u7528");
|
|
4774
4775
|
return false;
|
|
4775
4776
|
}
|
|
4776
4777
|
return true;
|
|
@@ -4781,74 +4782,75 @@ var init_handler = __esm({
|
|
|
4781
4782
|
return mode();
|
|
4782
4783
|
};
|
|
4783
4784
|
groupFilterEvent = (ctx3, config3, group, cd) => {
|
|
4785
|
+
const runLog = (text2) => log2(ctx3.logText, `${text2}: ${ctx3.eventId}`);
|
|
4784
4786
|
if (ctx3.isGroup) {
|
|
4785
4787
|
if (!config3?.group?.enable) {
|
|
4786
|
-
|
|
4788
|
+
runLog("\u5F53\u524D\u7FA4\u4E8B\u4EF6\u672A\u542F\u7528");
|
|
4787
4789
|
return false;
|
|
4788
4790
|
}
|
|
4789
4791
|
} else if (ctx3.isGuild) {
|
|
4790
4792
|
if (!config3?.guilds?.enable) {
|
|
4791
|
-
|
|
4793
|
+
runLog("\u5F53\u524D\u9891\u9053\u4E8B\u4EF6\u672A\u542F\u7528");
|
|
4792
4794
|
return false;
|
|
4793
4795
|
}
|
|
4794
4796
|
}
|
|
4795
4797
|
if (!cd) {
|
|
4796
|
-
|
|
4798
|
+
runLog("\u5F53\u524D\u5904\u4E8ECD\u4E2D");
|
|
4797
4799
|
return false;
|
|
4798
4800
|
}
|
|
4799
4801
|
if (config3?.user?.enable_list?.length) {
|
|
4800
4802
|
if (!config3?.user?.enable_list.includes(ctx3.userId)) {
|
|
4801
|
-
|
|
4803
|
+
runLog("\u7528\u6237\u672A\u5904\u4E8E\u767D\u540D\u5355");
|
|
4802
4804
|
return false;
|
|
4803
4805
|
}
|
|
4804
4806
|
}
|
|
4805
4807
|
if (config3?.user?.disable_list?.length) {
|
|
4806
4808
|
if (config3?.user?.disable_list.includes(ctx3.userId)) {
|
|
4807
|
-
|
|
4809
|
+
runLog("\u7528\u6237\u5904\u4E8E\u9ED1\u540D\u5355");
|
|
4808
4810
|
return false;
|
|
4809
4811
|
}
|
|
4810
4812
|
}
|
|
4811
4813
|
if (ctx3.isGroup) {
|
|
4812
4814
|
if (config3?.group?.enable_list?.length && !config3?.group?.enable_list.includes(ctx3.groupId)) {
|
|
4813
|
-
|
|
4815
|
+
runLog("\u7FA4\u672A\u5904\u4E8E\u767D\u540D\u5355");
|
|
4814
4816
|
return false;
|
|
4815
4817
|
}
|
|
4816
4818
|
if (config3?.group?.disable_list?.length && config3?.group?.disable_list.includes(ctx3.groupId)) {
|
|
4817
|
-
|
|
4819
|
+
runLog("\u7FA4\u5904\u4E8E\u9ED1\u540D\u5355");
|
|
4818
4820
|
return false;
|
|
4819
4821
|
}
|
|
4820
4822
|
if (group.member_enable?.length && !group.member_enable.includes(ctx3.userId)) {
|
|
4821
|
-
|
|
4823
|
+
runLog("\u7528\u6237\u672A\u5904\u4E8E\u7FA4\u6210\u5458\u767D\u540D\u5355");
|
|
4822
4824
|
return false;
|
|
4823
4825
|
}
|
|
4824
4826
|
if (group.member_disable?.length && group.member_disable.includes(ctx3.userId)) {
|
|
4825
|
-
|
|
4827
|
+
runLog("\u7528\u6237\u5904\u4E8E\u7FA4\u6210\u5458\u9ED1\u540D\u5355");
|
|
4826
4828
|
return false;
|
|
4827
4829
|
}
|
|
4828
4830
|
}
|
|
4829
4831
|
if (ctx3.isGuild) {
|
|
4830
4832
|
if (config3?.guilds?.enable_list?.length && !config3?.guilds?.enable_list.includes(ctx3.guildId)) {
|
|
4831
|
-
|
|
4833
|
+
runLog("\u9891\u9053\u672A\u5904\u4E8E\u767D\u540D\u5355");
|
|
4832
4834
|
return false;
|
|
4833
4835
|
}
|
|
4834
4836
|
if (config3?.guilds?.disable_list?.length && config3?.guilds?.disable_list.includes(ctx3.guildId)) {
|
|
4835
|
-
|
|
4837
|
+
runLog("\u9891\u9053\u5904\u4E8E\u9ED1\u540D\u5355");
|
|
4836
4838
|
return false;
|
|
4837
4839
|
}
|
|
4838
4840
|
if (config3?.channels?.enable_list?.length && !config3?.channels?.enable_list.includes(ctx3.channelId)) {
|
|
4839
|
-
|
|
4841
|
+
runLog("\u5B50\u9891\u9053\u672A\u5904\u4E8E\u767D\u540D\u5355");
|
|
4840
4842
|
return false;
|
|
4841
4843
|
}
|
|
4842
4844
|
if (config3?.channels?.disable_list?.length && config3?.channels?.disable_list.includes(ctx3.channelId)) {
|
|
4843
|
-
|
|
4845
|
+
runLog("\u5B50\u9891\u9053\u5904\u4E8E\u9ED1\u540D\u5355");
|
|
4844
4846
|
return false;
|
|
4845
4847
|
}
|
|
4846
4848
|
if (group.member_enable?.length && !group.member_enable.includes(ctx3.userId)) {
|
|
4847
|
-
|
|
4849
|
+
runLog("\u7528\u6237\u672A\u5904\u4E8E\u9891\u9053\u6210\u5458\u767D\u540D\u5355");
|
|
4848
4850
|
return false;
|
|
4849
4851
|
}
|
|
4850
4852
|
if (group.member_disable?.length && group.member_disable.includes(ctx3.userId)) {
|
|
4851
|
-
|
|
4853
|
+
runLog("\u7528\u6237\u5904\u4E8E\u9891\u9053\u6210\u5458\u9ED1\u540D\u5355");
|
|
4852
4854
|
return false;
|
|
4853
4855
|
}
|
|
4854
4856
|
}
|
|
@@ -4859,42 +4861,42 @@ var init_handler = __esm({
|
|
|
4859
4861
|
0: () => true,
|
|
4860
4862
|
1: () => {
|
|
4861
4863
|
if (!ctx3.atBot) {
|
|
4862
|
-
|
|
4864
|
+
runLog("\u5F53\u524D\u54CD\u5E94\u6A21\u5F0F\u4EC5\u5141\u8BB8@\u673A\u5668\u4EBA\u4F7F\u7528");
|
|
4863
4865
|
return false;
|
|
4864
4866
|
}
|
|
4865
4867
|
return true;
|
|
4866
4868
|
},
|
|
4867
4869
|
2: () => {
|
|
4868
4870
|
if (!ctx3.isAdmin && !ctx3.isMaster) {
|
|
4869
|
-
|
|
4871
|
+
runLog("\u5F53\u524D\u4EC5\u5141\u8BB8\u7BA1\u7406\u5458\u4F7F\u7528");
|
|
4870
4872
|
return false;
|
|
4871
4873
|
}
|
|
4872
4874
|
return true;
|
|
4873
4875
|
},
|
|
4874
4876
|
3: () => {
|
|
4875
4877
|
if (!ctx3.alias) {
|
|
4876
|
-
|
|
4878
|
+
runLog("\u5F53\u524D\u4EC5\u5141\u8BB8Bot\u522B\u540D\u89E6\u53D1\u4F7F\u7528");
|
|
4877
4879
|
return false;
|
|
4878
4880
|
}
|
|
4879
4881
|
return true;
|
|
4880
4882
|
},
|
|
4881
4883
|
4: () => {
|
|
4882
4884
|
if (!ctx3.alias && !ctx3.atBot) {
|
|
4883
|
-
|
|
4885
|
+
runLog("\u5F53\u524D\u4EC5\u5141\u8BB8Bot\u522B\u540D\u6216@\u673A\u5668\u4EBA\u89E6\u53D1\u4F7F\u7528");
|
|
4884
4886
|
return false;
|
|
4885
4887
|
}
|
|
4886
4888
|
return true;
|
|
4887
4889
|
},
|
|
4888
4890
|
5: () => {
|
|
4889
4891
|
if (!ctx3.isAdmin && !ctx3.isMaster && !ctx3.alias && !ctx3.atBot) {
|
|
4890
|
-
|
|
4892
|
+
runLog("\u5F53\u524D\u4EC5\u5141\u8BB8@\u6216\u522B\u540D\u89E6\u53D1(\u7BA1\u7406\u5458\u4F8B\u5916)");
|
|
4891
4893
|
return false;
|
|
4892
4894
|
}
|
|
4893
4895
|
return true;
|
|
4894
4896
|
},
|
|
4895
4897
|
6: () => {
|
|
4896
4898
|
if (!ctx3.isMaster) {
|
|
4897
|
-
|
|
4899
|
+
runLog("\u5F53\u524D\u4EC5\u5141\u8BB8\u4E3B\u4EBA\u4F7F\u7528");
|
|
4898
4900
|
return false;
|
|
4899
4901
|
}
|
|
4900
4902
|
return true;
|
|
@@ -4906,30 +4908,31 @@ var init_handler = __esm({
|
|
|
4906
4908
|
};
|
|
4907
4909
|
groupPrint = (ctx3, config3) => {
|
|
4908
4910
|
if (config3?.group?.log_enable_list?.length && !config3?.group?.log_enable_list.includes(ctx3.groupId)) {
|
|
4909
|
-
log2(ctx3.
|
|
4911
|
+
log2(ctx3.logText, `\u7FA4\u672A\u5904\u4E8E\u767D\u540D\u5355: ${ctx3.eventId}`);
|
|
4910
4912
|
return false;
|
|
4911
4913
|
}
|
|
4912
4914
|
if (config3?.group?.log_disable_list?.length && config3?.group?.log_disable_list.includes(ctx3.groupId)) {
|
|
4913
|
-
log2(ctx3.
|
|
4915
|
+
log2(ctx3.logText, `\u7FA4\u5904\u4E8E\u9ED1\u540D\u5355: ${ctx3.eventId}`);
|
|
4914
4916
|
return false;
|
|
4915
4917
|
}
|
|
4916
4918
|
return true;
|
|
4917
4919
|
};
|
|
4918
4920
|
guildPrint = (ctx3, config3) => {
|
|
4921
|
+
const runLog = (text2) => log2(ctx3.logText, `${text2}: ${ctx3.eventId}`);
|
|
4919
4922
|
if (config3?.guilds?.log_enable_list?.length && !config3?.guilds?.log_enable_list.includes(ctx3.guildId)) {
|
|
4920
|
-
|
|
4923
|
+
runLog("\u9891\u9053\u65E5\u5FD7\u672A\u5904\u4E8E\u767D\u540D\u5355");
|
|
4921
4924
|
return false;
|
|
4922
4925
|
}
|
|
4923
4926
|
if (config3?.guilds?.log_disable_list?.length && config3?.guilds?.log_disable_list.includes(ctx3.guildId)) {
|
|
4924
|
-
|
|
4927
|
+
runLog("\u9891\u9053\u65E5\u5FD7\u5904\u4E8E\u9ED1\u540D\u5355");
|
|
4925
4928
|
return false;
|
|
4926
4929
|
}
|
|
4927
4930
|
if (config3?.channels?.log_enable_list?.length && !config3?.channels?.log_enable_list.includes(ctx3.channelId)) {
|
|
4928
|
-
|
|
4931
|
+
runLog("\u5B50\u9891\u9053\u65E5\u5FD7\u672A\u5904\u4E8E\u767D\u540D\u5355");
|
|
4929
4932
|
return false;
|
|
4930
4933
|
}
|
|
4931
4934
|
if (config3?.channels?.log_disable_list?.length && config3?.channels?.log_disable_list.includes(ctx3.channelId)) {
|
|
4932
|
-
|
|
4935
|
+
runLog("\u5B50\u9891\u9053\u65E5\u5FD7\u5904\u4E8E\u9ED1\u540D\u5355");
|
|
4933
4936
|
return false;
|
|
4934
4937
|
}
|
|
4935
4938
|
return true;
|
|
@@ -16099,7 +16102,9 @@ __export(config_exports, {
|
|
|
16099
16102
|
getEnv: () => getEnv,
|
|
16100
16103
|
getFriendCfg: () => getFriendCfg,
|
|
16101
16104
|
getGroupCfg: () => getGroupCfg,
|
|
16105
|
+
getGroupsFileData: () => getGroupsFileData,
|
|
16102
16106
|
getGuildCfg: () => getGuildCfg,
|
|
16107
|
+
getPrivatesFileData: () => getPrivatesFileData,
|
|
16103
16108
|
getRenderCfg: () => getRenderCfg,
|
|
16104
16109
|
getYaml: () => getYaml,
|
|
16105
16110
|
groups: () => groups,
|
|
@@ -16112,7 +16117,6 @@ __export(config_exports, {
|
|
|
16112
16117
|
pm2: () => pm2,
|
|
16113
16118
|
port: () => port,
|
|
16114
16119
|
privates: () => privates,
|
|
16115
|
-
readConfig: () => readConfig,
|
|
16116
16120
|
redis: () => redis,
|
|
16117
16121
|
render: () => render2,
|
|
16118
16122
|
setConfig: () => setConfig,
|
|
@@ -16626,7 +16630,7 @@ var init_adapter = __esm({
|
|
|
16626
16630
|
});
|
|
16627
16631
|
|
|
16628
16632
|
// src/utils/config/file/config.ts
|
|
16629
|
-
var cache7, initConfig,
|
|
16633
|
+
var cache7, initConfig, config2, master, admin, config_default;
|
|
16630
16634
|
var init_config2 = __esm({
|
|
16631
16635
|
"src/utils/config/file/config.ts"() {
|
|
16632
16636
|
init_tools();
|
|
@@ -16646,19 +16650,13 @@ var init_config2 = __esm({
|
|
|
16646
16650
|
listeners.emit(`${FILE_CHANGE}:${name}`, options);
|
|
16647
16651
|
}, { type: "json" });
|
|
16648
16652
|
};
|
|
16649
|
-
readConfig = (dir2) => {
|
|
16650
|
-
const name = "config.json";
|
|
16651
|
-
const file = `${dir2}/${name}`;
|
|
16652
|
-
const data = requireFileSync(file, { type: "json" });
|
|
16653
|
-
return formatObject(data);
|
|
16654
|
-
};
|
|
16655
16653
|
config2 = () => cache7;
|
|
16656
16654
|
master = () => config2().master;
|
|
16657
16655
|
admin = () => config2().admin;
|
|
16658
16656
|
config_default = initConfig;
|
|
16659
16657
|
}
|
|
16660
16658
|
});
|
|
16661
|
-
var count, cache8, getCfg, isOld, migrate, format2, initGroups, groups, getGroupCfg, getGuildCfg, groups_default;
|
|
16659
|
+
var count, cache8, getCfg, isOld, migrate, format2, initGroups, groups, getGroupCfg, getGuildCfg, getGroupsFileData, groups_default;
|
|
16662
16660
|
var init_groups4 = __esm({
|
|
16663
16661
|
"src/utils/config/file/groups.ts"() {
|
|
16664
16662
|
init_watch();
|
|
@@ -16725,10 +16723,16 @@ var init_groups4 = __esm({
|
|
|
16725
16723
|
];
|
|
16726
16724
|
return getCfg(keys);
|
|
16727
16725
|
};
|
|
16726
|
+
getGroupsFileData = (dir2) => {
|
|
16727
|
+
const name = "groups.json";
|
|
16728
|
+
const file = `${dir2}/${name}`;
|
|
16729
|
+
const data = requireFileSync(file, { type: "json" });
|
|
16730
|
+
return isOld(data) ? migrate(file, data) : format2(data);
|
|
16731
|
+
};
|
|
16728
16732
|
groups_default = initGroups;
|
|
16729
16733
|
}
|
|
16730
16734
|
});
|
|
16731
|
-
var count2, cache9, getCfg2, isOld2, migrate2, format3, initPrivates, privates, getFriendCfg, getDirectCfg, privates_default;
|
|
16735
|
+
var count2, cache9, getCfg2, isOld2, migrate2, format3, initPrivates, privates, getFriendCfg, getDirectCfg, getPrivatesFileData, privates_default;
|
|
16732
16736
|
var init_privates = __esm({
|
|
16733
16737
|
"src/utils/config/file/privates.ts"() {
|
|
16734
16738
|
init_watch();
|
|
@@ -16783,6 +16787,12 @@ var init_privates = __esm({
|
|
|
16783
16787
|
const keys = [`Bot:${selfId}:${userId}`, `Bot:${selfId}`, userId, "default"];
|
|
16784
16788
|
return getCfg2(keys);
|
|
16785
16789
|
};
|
|
16790
|
+
getPrivatesFileData = (dir2) => {
|
|
16791
|
+
const name = "privates.json";
|
|
16792
|
+
const file = `${dir2}/${name}`;
|
|
16793
|
+
const data = requireFileSync(file, { type: "json" });
|
|
16794
|
+
return isOld2(data) ? migrate2(file, data) : format3(data);
|
|
16795
|
+
};
|
|
16786
16796
|
privates_default = initPrivates;
|
|
16787
16797
|
}
|
|
16788
16798
|
});
|
|
@@ -20006,7 +20016,7 @@ var init_config3 = __esm({
|
|
|
20006
20016
|
getConfig = async (req, res) => {
|
|
20007
20017
|
const { type } = req.body;
|
|
20008
20018
|
if (type === "config") {
|
|
20009
|
-
const cfg =
|
|
20019
|
+
const cfg = config2();
|
|
20010
20020
|
return createSuccessResponse(res, cfg);
|
|
20011
20021
|
}
|
|
20012
20022
|
if (type === "adapter") {
|
|
@@ -20014,11 +20024,11 @@ var init_config3 = __esm({
|
|
|
20014
20024
|
return createSuccessResponse(res, cfg);
|
|
20015
20025
|
}
|
|
20016
20026
|
if (type === "groups") {
|
|
20017
|
-
const cfg =
|
|
20027
|
+
const cfg = getGroupsFileData(karinPathConfig);
|
|
20018
20028
|
return createSuccessResponse(res, cfg);
|
|
20019
20029
|
}
|
|
20020
20030
|
if (type === "privates") {
|
|
20021
|
-
const cfg =
|
|
20031
|
+
const cfg = getPrivatesFileData(karinPathConfig);
|
|
20022
20032
|
return createSuccessResponse(res, cfg);
|
|
20023
20033
|
}
|
|
20024
20034
|
if (type === "render") {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./vendor-react-Hg1DVPZt.js";import{P as r}from"./components-9RKTV4LX.js";import"./vendor-others-B6NXaB-r.js";import"./vendor-editor-B8hjWfkw.js";import"./vendor-ui-utils-5rYIvRjL.js";import"./vendor-heroui-WfpTlnyv.js";import"./page-dashboard-BewrlGFW.js";import"./hooks-D65eaS4p.js";import"./utils-DqFE1yN-.js";import"./vendor-visual-mzxhMYK3.js";const x=()=>t.jsx("div",{className:"min-h-screen flex items-center justify-center",children:t.jsx(r,{})});export{x as default};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as p}from"./vendor-react-
|
|
1
|
+
import{V as p}from"./vendor-react-Hg1DVPZt.js";import{a5 as g}from"./components-9RKTV4LX.js";const k=async(t,n,e,r)=>{const{setIsLogModalOpen:i,setTaskId:c,setTaskLogs:o,setTaskName:f}=n;f("更新插件");const a=["开始创建更新任务...",`options: ${JSON.stringify(t)}`];o(a);try{const s=await g(t);if(s.success&&s.taskId)c(s.taskId),o([...a,`
|
|
2
2
|
任务创建成功!`,`任务ID: ${s.taskId}`,"正在连接任务执行日志..."]),i(!0),typeof e=="function"&&e(),typeof r=="function"&&r();else throw new Error(s.message||"未知错误")}catch(s){console.error("更新失败:",s),p.error(`更新失败: ${s.message}`)}};export{k as c};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/web/index.html
CHANGED
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
content="viewport-fit=cover, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
|
15
15
|
name="viewport" />
|
|
16
16
|
<link href="/web/assets/ico/favicon-BoqZd694.ico" rel="icon" />
|
|
17
|
-
<script type="module" crossorigin src="/web/assets/js/entry-
|
|
17
|
+
<script type="module" crossorigin src="/web/assets/js/entry-CzDSdA4M.js"></script>
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-editor-B8hjWfkw.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-others-
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-others-B6NXaB-r.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-ui-utils-5rYIvRjL.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-react-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-heroui-
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/hooks-
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-visual-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/components-
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/utils-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/web/assets/js/page-dashboard-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-react-Hg1DVPZt.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-heroui-WfpTlnyv.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/hooks-D65eaS4p.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/vendor-visual-mzxhMYK3.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/components-9RKTV4LX.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/utils-DqFE1yN-.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/web/assets/js/page-dashboard-BewrlGFW.js">
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/web/assets/css/vendor-editor-CFbL2ovg.css">
|
|
29
29
|
<link rel="stylesheet" crossorigin href="/web/assets/css/vendor-others-ZgkIHsf0.css">
|
|
30
30
|
<link rel="stylesheet" crossorigin href="/web/assets/css/components-ep7vm38G.css">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-karin",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.11",
|
|
4
4
|
"description": "Lightweight, efficient, concise, and stable robot framework.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -190,4 +190,4 @@
|
|
|
190
190
|
"registry": "https://registry.npmjs.org"
|
|
191
191
|
},
|
|
192
192
|
"time": "2025-05-03T19:55:55.123Z"
|
|
193
|
-
}
|
|
193
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./vendor-react-BDRVXu1f.js";import{P as r}from"./components-D6OCw7kO.js";import"./vendor-others-D7Rwl1O6.js";import"./vendor-editor-B8hjWfkw.js";import"./vendor-ui-utils-5rYIvRjL.js";import"./vendor-heroui-96DnnqOT.js";import"./page-dashboard-BX_VXjx6.js";import"./hooks-BoS7DPVe.js";import"./utils-DSlRvNHw.js";import"./vendor-visual-BMhnpZxY.js";const x=()=>t.jsx("div",{className:"min-h-screen flex items-center justify-center",children:t.jsx(r,{})});export{x as default};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|