koishi-plugin-cocoyyy-console 1.0.16 → 1.0.17

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.
Files changed (2) hide show
  1. package/lib/index.js +11 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1532,6 +1532,7 @@ __name(checkShitOrNot, "checkShitOrNot");
1532
1532
 
1533
1533
  // src/services/son_func/shit_or_not_command.ts
1534
1534
  var local_config = null;
1535
+ var think_flag = false;
1535
1536
  function registerShitOrNotCommands(ctx, config) {
1536
1537
  if (config?.config_path) {
1537
1538
  local_config = loadYamlConfig(config.config_path);
@@ -1560,13 +1561,21 @@ son判断模式列表:
1560
1561
  } else {
1561
1562
  if (!session.quote) return "请引用消息后使用功能";
1562
1563
  }
1564
+ if (think_flag) return "请等待思考结果";
1563
1565
  const parttern = args?.[0];
1564
1566
  if (!parttern) return "请提供正确判断模式,如: [引用消息] @bot son [判断模式]";
1565
1567
  if (!local_config) return "未加载配置文件,请查看日志";
1566
1568
  const parttern_msg = local_config.shit_or_not?.prompts[parttern];
1567
1569
  if (!parttern_msg) return "未找到判断模式,请查看日志";
1568
- let exec = await checkShitOrNot(session, parttern_msg, config);
1569
- return exec;
1570
+ await session.send("已收到,正在品鉴中...");
1571
+ think_flag = true;
1572
+ try {
1573
+ let exec = await checkShitOrNot(session, parttern_msg, config);
1574
+ if (exec == null) return "品鉴失败,请查看日志";
1575
+ return exec;
1576
+ } finally {
1577
+ think_flag = false;
1578
+ }
1570
1579
  });
1571
1580
  }
1572
1581
  __name(registerShitOrNotCommands, "registerShitOrNotCommands");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-cocoyyy-console",
3
3
  "description": "自用koishi插件,功能包含复读,记录黑历史,*人等",
4
- "version": "1.0.16",
4
+ "version": "1.0.17",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "contributors": [