node-karin 1.3.9 → 1.3.10
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/CHANGELOG.md +7 -0
- package/dist/index.js +46 -41
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [1.3.10](https://github.com/KarinJS/Karin/compare/core-v1.3.9...core-v1.3.10) (2025-02-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🐛 Bug Fixes
|
|
7
|
+
|
|
8
|
+
* 负责捕获处理非OneBOT11标准适配器报错的问题 ([#267](https://github.com/KarinJS/Karin/issues/267)) ([9291a0c](https://github.com/KarinJS/Karin/commit/9291a0c1de9cf02aa54439807d497ecd511cb49a))
|
|
9
|
+
|
|
3
10
|
## [1.3.9](https://github.com/KarinJS/Karin/compare/core-v1.3.8...core-v1.3.9) (2025-02-14)
|
|
4
11
|
|
|
5
12
|
|
package/dist/index.js
CHANGED
|
@@ -13633,49 +13633,54 @@ var init_event = __esm({
|
|
|
13633
13633
|
import fs28 from "node:fs";
|
|
13634
13634
|
function AdapterConvertKarin(data = []) {
|
|
13635
13635
|
const elements = [];
|
|
13636
|
-
|
|
13637
|
-
|
|
13638
|
-
|
|
13639
|
-
|
|
13640
|
-
|
|
13641
|
-
|
|
13642
|
-
|
|
13643
|
-
|
|
13644
|
-
|
|
13645
|
-
|
|
13646
|
-
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
|
|
13657
|
-
|
|
13658
|
-
|
|
13659
|
-
|
|
13660
|
-
|
|
13661
|
-
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
13666
|
-
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13676
|
-
|
|
13636
|
+
try {
|
|
13637
|
+
for (const i of data) {
|
|
13638
|
+
switch (i.type) {
|
|
13639
|
+
case "text":
|
|
13640
|
+
elements.push(segment_exports.text(i.data.text));
|
|
13641
|
+
break;
|
|
13642
|
+
case "face":
|
|
13643
|
+
elements.push(segment_exports.face(Number(i.data.id)));
|
|
13644
|
+
break;
|
|
13645
|
+
case "image":
|
|
13646
|
+
elements.push(segment_exports.image(i.data.url || i.data.file, { fileType: i.data.type }));
|
|
13647
|
+
break;
|
|
13648
|
+
case "record":
|
|
13649
|
+
elements.push(segment_exports.record(i.data.url || i.data.file, i.data.magic === 1));
|
|
13650
|
+
break;
|
|
13651
|
+
case "video":
|
|
13652
|
+
elements.push(segment_exports.video(i.data.url || i.data.file));
|
|
13653
|
+
break;
|
|
13654
|
+
case "at":
|
|
13655
|
+
elements.push(segment_exports.at(i.data.qq, i.data.name));
|
|
13656
|
+
break;
|
|
13657
|
+
case "contact":
|
|
13658
|
+
elements.push(segment_exports.contact(i.data.type === "qq" ? "friend" : "group", i.data.id));
|
|
13659
|
+
break;
|
|
13660
|
+
case "location":
|
|
13661
|
+
elements.push(segment_exports.location(
|
|
13662
|
+
Number(i.data.lat),
|
|
13663
|
+
Number(i.data.lon),
|
|
13664
|
+
i.data.title || "",
|
|
13665
|
+
i.data.content || ""
|
|
13666
|
+
));
|
|
13667
|
+
break;
|
|
13668
|
+
case "reply":
|
|
13669
|
+
elements.push(segment_exports.reply(i.data.id));
|
|
13670
|
+
break;
|
|
13671
|
+
case "json":
|
|
13672
|
+
elements.push(segment_exports.json(i.data.data));
|
|
13673
|
+
break;
|
|
13674
|
+
case "xml":
|
|
13675
|
+
elements.push(segment_exports.xml(i.data.data));
|
|
13676
|
+
break;
|
|
13677
|
+
default: {
|
|
13678
|
+
elements.push(segment_exports.text(JSON.stringify(i)));
|
|
13679
|
+
}
|
|
13677
13680
|
}
|
|
13678
13681
|
}
|
|
13682
|
+
} catch (error) {
|
|
13683
|
+
return elements;
|
|
13679
13684
|
}
|
|
13680
13685
|
return elements;
|
|
13681
13686
|
}
|