alemonjs-aichat 1.0.28 → 1.0.29

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.
@@ -1,7 +1,7 @@
1
1
  var title = "IA聊天插件";
2
2
  var desc = "一个基于AI的聊天插件,支持多种AI模型和丰富的功能配置,适用于各种聊天场景。";
3
3
  var name = "alemonjs-aichat";
4
- var version = "v1.0.28";
4
+ var version = "v1.0.29";
5
5
  var by = "AlemonJS";
6
6
  var list = [
7
7
  {
@@ -367,29 +367,6 @@ var res = onResponse(selects, async (e, next) => {
367
367
  message.send(format(Text(`当前工具列表及状态:\n${toolList}`)));
368
368
  return;
369
369
  }
370
- // 控制工具开关
371
- if (/(\/|#)(开启|关闭)工具(.*)$/i.test(e.msg)) {
372
- if (!e.IsMaster || String(e.UserId) != "3501869534") {
373
- return;
374
- }
375
- const match = e.msg.match(/(\/|#)(开启|关闭)工具(.*)$/i);
376
- if (!match) {
377
- message.send(format(Text("格式错误,请按照 格式:/开启工具 <工具名称> 或 /关闭工具 <工具名称> 进行设置")));
378
- return;
379
- }
380
- const [, , action, toolName] = match;
381
- const enable = action === "开启";
382
- if (enable) {
383
- redisClient.enableTool(e.guid, toolName.trim());
384
- }
385
- else {
386
- {
387
- redisClient.disableTool(e.guid, toolName.trim());
388
- }
389
- }
390
- message.send(format(Text(`已${enable ? "开启" : "关闭"}工具 ${toolName.trim()} !`)));
391
- return;
392
- }
393
370
  // 控制工具提示开关
394
371
  if (/(\/|#)(开启|关闭)工具(调用)?提示$/i.test(e.msg)) {
395
372
  if (!e.IsMaster || String(e.UserId) != "3501869534") {
@@ -438,6 +415,29 @@ var res = onResponse(selects, async (e, next) => {
438
415
  message.send(format(Text(`已${enable ? "开启" : "关闭"}工具提示详情功能 !`)));
439
416
  return;
440
417
  }
418
+ // 控制工具开关
419
+ if (/(\/|#)(开启|关闭)工具(.*)$/i.test(e.msg)) {
420
+ if (!e.IsMaster || String(e.UserId) != "3501869534") {
421
+ return;
422
+ }
423
+ const match = e.msg.match(/(\/|#)(开启|关闭)工具(.*)$/i);
424
+ if (!match) {
425
+ message.send(format(Text("格式错误,请按照 格式:/开启工具 <工具名称> 或 /关闭工具 <工具名称> 进行设置")));
426
+ return;
427
+ }
428
+ const [, , action, toolName] = match;
429
+ const enable = action === "开启";
430
+ if (enable) {
431
+ redisClient.enableTool(e.guid, toolName.trim());
432
+ }
433
+ else {
434
+ {
435
+ redisClient.disableTool(e.guid, toolName.trim());
436
+ }
437
+ }
438
+ message.send(format(Text(`已${enable ? "开启" : "关闭"}工具 ${toolName.trim()} !`)));
439
+ return;
440
+ }
441
441
  next();
442
442
  });
443
443
 
@@ -19,7 +19,7 @@ const children = [
19
19
  },
20
20
  // setting (包含大量子命令)
21
21
  {
22
- regular: Regular.or(/(\/|#)添加ai$/i, /(\/|#)添加ai\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/i, /(\/|#)(切换)(ai|配置) ?(.*)/i, /(\/|#)添加提示词$/i, /(\/|#)添加提示词 (\S+) ([\s\S]+)/i, /(\/|#)(删除)(提示词|提示词列表) ?(.*)/i, /(\/|#)(切换|设置)提示词 ?(.*)$/i, /(\/|#)清空提示词$/i, /(\/|#)删除ai\s(\S+)$/i, /(\/|#)(开启|启用|关闭|禁用)好感度$/i, /(\/|#)(开启|关闭)(全部)?聊天$/i, /(\/|#)(开启|关闭)语音回复$/i, /(\/|#)切换图床(.*)$/i, /(\/|#)修改 ?(.+) ?模型 ?(.+)$/i, /(\/|#)(关闭|开启)复杂(输出|回复)$/i, /(\/|#)(关闭|禁止|不可以|不允许|开启|可以|允许)(涩涩|色色)$/i, /(\/|#)切换模型(.*)$/i, /(\/|#)(关闭|开启)主动(搭话|回复)$/i, /(\/|#)(开启|关闭)深度思考$/i, /(\/|#)(设置|修改)(ai)?(.*)rapi模式(开启|关闭)$/i, /(\/|#)(开启|关闭)仅艾特触发$/i, /(\/|#)工具列表$/i, /(\/|#)(开启|关闭)(MCP)?工具$/i, /(\/|#)(开启|关闭)工具提示$/i, /(\/|#)(开启|关闭)工具(调用)?提示撤回$/i, /(\/|#)(开启|关闭)工具(调用)?提示详情$/i, /(\/|#)(开启|关闭)工具(.*)$/i, /(\/|#)测试$/i),
22
+ regular: Regular.or(/(\/|#)添加ai$/i, /(\/|#)添加ai\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/i, /(\/|#)(切换)(ai|配置) ?(.*)/i, /(\/|#)添加提示词$/i, /(\/|#)添加提示词 (\S+) ([\s\S]+)/i, /(\/|#)(删除)(提示词|提示词列表) ?(.*)/i, /(\/|#)(切换|设置)提示词 ?(.*)$/i, /(\/|#)清空提示词$/i, /(\/|#)删除ai\s(\S+)$/i, /(\/|#)(开启|启用|关闭|禁用)好感度$/i, /(\/|#)(开启|关闭)(全部)?聊天$/i, /(\/|#)(开启|关闭)语音回复$/i, /(\/|#)切换图床(.*)$/i, /(\/|#)修改 ?(.+) ?模型 ?(.+)$/i, /(\/|#)(关闭|开启)复杂(输出|回复)$/i, /(\/|#)(关闭|禁止|不可以|不允许|开启|可以|允许)(涩涩|色色)$/i, /(\/|#)切换模型(.*)$/i, /(\/|#)(关闭|开启)主动(搭话|回复)$/i, /(\/|#)(开启|关闭)深度思考$/i, /(\/|#)(设置|修改)(ai)?(.*)rapi模式(开启|关闭)$/i, /(\/|#)(开启|关闭)仅艾特触发$/i, /(\/|#)工具列表$/i, /(\/|#)(开启|关闭)(MCP)?工具$/i, /(\/|#)(开启|关闭)工具(.*)$/i, /(\/|#)(开启|关闭)工具提示$/i, /(\/|#)(开启|关闭)工具(调用)?提示撤回$/i, /(\/|#)(开启|关闭)工具(调用)?提示详情$/i, /(\/|#)测试$/i),
23
23
  handler: lazy(() => import('../response/setting/res.js')),
24
24
  },
25
25
  // affection
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alemonjs-aichat",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "alemonjs-aichat",
5
5
  "author": "suancaixianyu",
6
6
  "license": "MIT",