koishi-plugin-bilibili-videolink-analysis 1.1.22 → 1.1.23
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.js +3 -27
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -129,6 +129,7 @@ exports.Config = Schema.intersect([
|
|
|
129
129
|
Schema.object({
|
|
130
130
|
pageclose: Schema.boolean().default(true).description("自动`page.close()`<br>非开发者请勿改动").experimental(),
|
|
131
131
|
loggerinfo: Schema.boolean().default(false).description("日志调试输出 `日常使用无需开启`<br>非开发者请勿改动").experimental(),
|
|
132
|
+
loggerinfofulljson: Schema.boolean().default(false).description("打印完整的机器人发送的json输出").experimental(),
|
|
132
133
|
}).description("开发者选项"),
|
|
133
134
|
]);
|
|
134
135
|
|
|
@@ -646,35 +647,10 @@ display: none !important;
|
|
|
646
647
|
children: allElements
|
|
647
648
|
});
|
|
648
649
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
// 递归处理对象,截断长字符串
|
|
653
|
-
function truncateLongStrings(obj, maxLength = 150) {
|
|
654
|
-
if (!obj) return obj;
|
|
655
|
-
|
|
656
|
-
if (typeof obj === 'string' && obj.length > maxLength) {
|
|
657
|
-
return obj.substring(0, maxLength) + '... [截断剩余' + (obj.length - maxLength) + '字符]';
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
if (Array.isArray(obj)) {
|
|
661
|
-
return obj.map(item => truncateLongStrings(item, maxLength));
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
if (typeof obj === 'object') {
|
|
665
|
-
const newObj = {};
|
|
666
|
-
for (const key in obj) {
|
|
667
|
-
newObj[key] = truncateLongStrings(obj[key], maxLength);
|
|
668
|
-
}
|
|
669
|
-
return newObj;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
return obj;
|
|
650
|
+
if (config.loggerinfofulljson) {
|
|
651
|
+
logInfo(JSON.stringify(figureContent, null, 2));
|
|
673
652
|
}
|
|
674
653
|
|
|
675
|
-
// 截断长字符串后再打印
|
|
676
|
-
logInfo(JSON.stringify(truncateLongStrings(logObject), null, 2));
|
|
677
|
-
|
|
678
654
|
// 发送合并转发消息
|
|
679
655
|
await session.send(figureContent);
|
|
680
656
|
} else {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "koishi-plugin-bilibili-videolink-analysis",
|
|
3
3
|
"description": "[<ruby>Bilibili视频解析<rp>(</rp><rt>点我查看食用方法</rt><rp>)</rp></ruby>](https://www.npmjs.com/package/koishi-plugin-bilibili-videolink-analysis)解析B站链接(支持小程序卡片)支持搜索点播功能!灵感来自完美的 [bili-parser](/market?keyword=bili-parser) !",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.23",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"typings": "lib/index.d.ts",
|
|
8
8
|
"files": [
|