koishi-plugin-cocoyyy-console 1.1.0 → 1.1.1-beta.1

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 +7 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1538,8 +1538,7 @@ async function callOpenRouter(api_url, api_key, api_model = "gpt-4o-mini", messa
1538
1538
  logger.error("[callOpenRouter Error]: OpenRouter 请求失败", {
1539
1539
  status,
1540
1540
  detail,
1541
- url: err.config?.url,
1542
- payload: err.config?.data
1541
+ url: err.config?.url
1543
1542
  });
1544
1543
  const errorMessage = `test error${status ? `(${status})` : ""}: ${detail}`;
1545
1544
  return { err: errorMessage, resp: null };
@@ -1578,11 +1577,13 @@ async function checkShitOrNot(session, parttern_msg, config) {
1578
1577
  }
1579
1578
  chatHistory.push({ role: "assistant", content: [{ type: "text", text: resp }] });
1580
1579
  const quoteContent = session.quote.content;
1580
+ logger.info("[checkShitOrNot Info]: 引用消息内容: " + quoteContent);
1581
1581
  const { imageUrls, text } = extractImageAndText(quoteContent);
1582
1582
  if (!text && imageUrls.length === 0) {
1583
1583
  logger.warn("[checkShitOrNot Warn]: 引用消息中未发现文本或图片");
1584
1584
  return "引用消息中未发现文本或图片";
1585
1585
  }
1586
+ logger.info("[checkShitOrNot Info]: 提取图片 URL:\n" + imageUrls.join(",\n"));
1586
1587
  const targetContent = [
1587
1588
  ...text ? [{ type: "text", text }] : [],
1588
1589
  ...imageUrls.map((url) => ({ type: "image_url", image_url: { url } }))
@@ -2083,7 +2084,7 @@ var is_gaming = false;
2083
2084
  var chatPrompt = [];
2084
2085
  var chatHistory2 = [];
2085
2086
  var gameTimeout = null;
2086
- var GAME_TIMEOUT_MINUTES = local_config2?.game?.timeout_minutes || 10;
2087
+ var GAME_TIMEOUT_MINUTES = -1;
2087
2088
  async function startSituationPuzzle(config) {
2088
2089
  chatPrompt = [];
2089
2090
  chatHistory2 = [];
@@ -2097,6 +2098,9 @@ async function startSituationPuzzle(config) {
2097
2098
  }
2098
2099
  chatPrompt.push({ role: "assistant", content: [{ type: "text", text: resp }] });
2099
2100
  is_gaming = true;
2101
+ if (GAME_TIMEOUT_MINUTES <= 0) {
2102
+ GAME_TIMEOUT_MINUTES = local_config2?.game?.timeout_minutes || 10;
2103
+ }
2100
2104
  clearGameTimeout();
2101
2105
  gameTimeout = setTimeout(async () => {
2102
2106
  logger.info(`[SituationPuzzle Timeout]: 游戏已超时(${GAME_TIMEOUT_MINUTES}分钟),自动结束游戏`);
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.0",
4
+ "version": "1.1.1-beta.1",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "contributors": [