koishi-plugin-chatluna-character 0.0.69 → 0.0.71

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/lib/index.cjs CHANGED
@@ -350,7 +350,8 @@ function parseXmlToObject(xml) {
350
350
  const attrRegex = new RegExp(`${name3}=['"]?([^'"]+)['"]?`);
351
351
  const attrMatch = attributes.match(attrRegex);
352
352
  if (!attrMatch) {
353
- throw new Error(`Failed to parse ${name3} attribute: ${xml}`);
353
+ logger.warn(`Failed to parse ${name3} attribute: ${xml}`);
354
+ return "";
354
355
  }
355
356
  return attrMatch[1];
356
357
  }, "getAttr");
@@ -358,7 +359,7 @@ function parseXmlToObject(xml) {
358
359
  const id = getAttr("id");
359
360
  const type = getAttr("type") || "text";
360
361
  const sticker = getAttr("sticker");
361
- if (!content) {
362
+ if (content === void 0) {
362
363
  throw new Error("Failed to parse content: " + xml);
363
364
  }
364
365
  return { name: name2, id, type, sticker, content };
package/lib/index.mjs CHANGED
@@ -318,7 +318,8 @@ function parseXmlToObject(xml) {
318
318
  const attrRegex = new RegExp(`${name3}=['"]?([^'"]+)['"]?`);
319
319
  const attrMatch = attributes.match(attrRegex);
320
320
  if (!attrMatch) {
321
- throw new Error(`Failed to parse ${name3} attribute: ${xml}`);
321
+ logger.warn(`Failed to parse ${name3} attribute: ${xml}`);
322
+ return "";
322
323
  }
323
324
  return attrMatch[1];
324
325
  }, "getAttr");
@@ -326,7 +327,7 @@ function parseXmlToObject(xml) {
326
327
  const id = getAttr("id");
327
328
  const type = getAttr("type") || "text";
328
329
  const sticker = getAttr("sticker");
329
- if (!content) {
330
+ if (content === void 0) {
330
331
  throw new Error("Failed to parse content: " + xml);
331
332
  }
332
333
  return { name: name2, id, type, sticker, content };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "koishi-plugin-chatluna-character",
3
3
  "description": "Let the large language model play a role, disguise as a group friend",
4
- "version": "0.0.69",
4
+ "version": "0.0.71",
5
5
  "type": "module",
6
6
  "main": "lib/index.cjs",
7
7
  "module": "lib/index.mjs",
8
8
  "typings": "lib/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
+ "types": "./lib/index.d.ts",
11
12
  "import": "./lib/index.mjs",
12
- "require": "./lib/index.cjs",
13
- "types": "./lib/index.d.ts"
13
+ "require": "./lib/index.cjs"
14
14
  },
15
15
  "./package.json": "./package.json"
16
16
  },
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "peerDependencies": {
69
69
  "koishi": "^4.18.0",
70
- "koishi-plugin-chatluna": "^1.0.0-beta.95"
70
+ "koishi-plugin-chatluna": "^1.0.0-beta.100"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=18.0.0"