@leoqlin/openclaw-qqbot 1.6.17 → 1.6.19
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/dist/index.js +20 -0
- package/index.ts +24 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13,6 +13,26 @@ const plugin = {
|
|
|
13
13
|
api.registerChannel({ plugin: qqbotPlugin });
|
|
14
14
|
registerChannelTool(api);
|
|
15
15
|
registerRemindTool(api);
|
|
16
|
+
// 禁用内置 qqbot 插件,避免与本插件冲突
|
|
17
|
+
try {
|
|
18
|
+
const configApi = api.runtime.config;
|
|
19
|
+
const currentCfg = structuredClone(configApi.loadConfig());
|
|
20
|
+
const plugins = (currentCfg.plugins ?? {});
|
|
21
|
+
const entries = (plugins.entries ?? {});
|
|
22
|
+
const qqbotEntry = (entries.qqbot ?? {});
|
|
23
|
+
if (qqbotEntry.enabled !== false) {
|
|
24
|
+
qqbotEntry.enabled = false;
|
|
25
|
+
entries.qqbot = qqbotEntry;
|
|
26
|
+
plugins.entries = entries;
|
|
27
|
+
currentCfg.plugins = plugins;
|
|
28
|
+
configApi.writeConfigFile(currentCfg).catch((e) => {
|
|
29
|
+
console.warn(`[qqbot] failed to disable builtin qqbot plugin: ${e?.message ?? e}`);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
console.warn(`[qqbot] failed to disable builtin qqbot plugin: ${e?.message ?? e}`);
|
|
35
|
+
}
|
|
16
36
|
},
|
|
17
37
|
};
|
|
18
38
|
export default plugin;
|
package/index.ts
CHANGED
|
@@ -16,6 +16,30 @@ const plugin = {
|
|
|
16
16
|
api.registerChannel({ plugin: qqbotPlugin as any });
|
|
17
17
|
registerChannelTool(api);
|
|
18
18
|
registerRemindTool(api);
|
|
19
|
+
|
|
20
|
+
// 禁用内置 qqbot 插件,避免与本插件冲突
|
|
21
|
+
try {
|
|
22
|
+
const configApi = api.runtime.config as {
|
|
23
|
+
loadConfig: () => Record<string, unknown>;
|
|
24
|
+
writeConfigFile: (cfg: unknown) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
const currentCfg = structuredClone(configApi.loadConfig()) as Record<string, unknown>;
|
|
27
|
+
const plugins = (currentCfg.plugins ?? {}) as Record<string, unknown>;
|
|
28
|
+
const entries = (plugins.entries ?? {}) as Record<string, unknown>;
|
|
29
|
+
const qqbotEntry = (entries.qqbot ?? {}) as Record<string, unknown>;
|
|
30
|
+
|
|
31
|
+
if (qqbotEntry.enabled !== false) {
|
|
32
|
+
qqbotEntry.enabled = false;
|
|
33
|
+
entries.qqbot = qqbotEntry;
|
|
34
|
+
plugins.entries = entries;
|
|
35
|
+
currentCfg.plugins = plugins;
|
|
36
|
+
configApi.writeConfigFile(currentCfg).catch((e: any) => {
|
|
37
|
+
console.warn(`[qqbot] failed to disable builtin qqbot plugin: ${e?.message ?? e}`);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
} catch (e: any) {
|
|
41
|
+
console.warn(`[qqbot] failed to disable builtin qqbot plugin: ${e?.message ?? e}`);
|
|
42
|
+
}
|
|
19
43
|
},
|
|
20
44
|
};
|
|
21
45
|
|