koishi-plugin-cocoyyy-console 1.1.3-alpha.3 → 1.1.3-alpha.5

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 +3 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -2428,7 +2428,8 @@ var gameList = [
2428
2428
  ];
2429
2429
  var commandList = [
2430
2430
  "gamelist",
2431
- "startgame"
2431
+ "startgame",
2432
+ "endgame"
2432
2433
  ];
2433
2434
  function registerGameCommands(ctx, game_config, ai_config) {
2434
2435
  if (game_config?.config_path) {
@@ -2486,7 +2487,6 @@ function registerGameCommands(ctx, game_config, ai_config) {
2486
2487
  if (!is_at_bot(session)) return;
2487
2488
  }
2488
2489
  if (!now_game) return "未开始游戏";
2489
- if (now_game == gameList[0].command) return;
2490
2490
  if (is_thinking) return "正在思考,请耐心等待...";
2491
2491
  try {
2492
2492
  is_thinking = true;
@@ -2494,7 +2494,6 @@ function registerGameCommands(ctx, game_config, ai_config) {
2494
2494
  let resp_text = "";
2495
2495
  switch (now_game) {
2496
2496
  case gameList[0].command:
2497
- await session.send("正在结束游戏...");
2498
2497
  resp_text = await endSituationPuzzle(ai_config);
2499
2498
  now_game = null;
2500
2499
  return checkResp(resp_text);
@@ -2540,6 +2539,7 @@ async function situationPuzzleMiddleware(session, ai_config) {
2540
2539
  const withoutTags = content.replace(/<[^>]+>/g, " ");
2541
2540
  const text = withoutTags.replace(/\s+/g, " ").trim();
2542
2541
  try {
2542
+ if (is_thinking) return "正在思考,请耐心等待...";
2543
2543
  is_thinking = true;
2544
2544
  if (text.includes("reroll")) {
2545
2545
  const resp2 = await rerollSituationPuzzle(ai_config);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-cocoyyy-console",
3
3
  "description": "自用koishi插件,功能包含复读,记录黑历史,*人等",
4
- "version": "1.1.3-alpha.3",
4
+ "version": "1.1.3-alpha.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "contributors": [