koishi-plugin-video-parser-all 0.4.2 → 0.4.3

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 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -581,12 +581,22 @@ function clearAllCache() {
581
581
  }
582
582
  const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
583
583
  function buildForwardNode(session, content, botName) {
584
+ let messageContent;
585
+ if (Array.isArray(content)) {
586
+ messageContent = content;
587
+ }
588
+ else if (content && typeof content === 'object' && content.type) {
589
+ messageContent = [content];
590
+ }
591
+ else {
592
+ messageContent = [koishi_1.h.text(String(content))];
593
+ }
584
594
  return {
585
595
  type: 'node',
586
596
  data: {
587
597
  name: botName.substring(0, 15),
588
598
  uin: session.selfId.toString(),
589
- content: Array.isArray(content) ? content : [koishi_1.h.text(content)],
599
+ content: messageContent,
590
600
  time: Math.floor(Date.now() / 1000)
591
601
  }
592
602
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-video-parser-all",
3
3
  "description": "Koishi 全平台视频解析插件,支持抖音/快手/B站/小红书/微博/今日头条/皮皮搞笑/皮皮虾/西瓜视频/最右视频链接解析",
4
- "version": "0.4.2",
4
+ "version": "0.4.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [