koishi-plugin-share-links-analysis 0.2.3 → 0.2.5
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 +9 -20
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -6,7 +6,6 @@ exports.apply = apply;
|
|
|
6
6
|
const koishi_1 = require("koishi");
|
|
7
7
|
const core_1 = require("./core");
|
|
8
8
|
const xiaohongshu_1 = require("./parsers/xiaohongshu");
|
|
9
|
-
const types_1 = require("koishi-plugin-adapter-onebot/lib/types");
|
|
10
9
|
exports.name = 'share-links-analysis';
|
|
11
10
|
exports.inject = {
|
|
12
11
|
required: ['BiliBiliVideo', 'database', 'puppeteer'],
|
|
@@ -132,8 +131,7 @@ async function sendResult(session, config, result, logger) {
|
|
|
132
131
|
return; // 成功,结束
|
|
133
132
|
}
|
|
134
133
|
catch (err) {
|
|
135
|
-
logger.warn('
|
|
136
|
-
await sendResult_plain(session, config, result, logger);
|
|
134
|
+
logger.warn('合并转发失败:', err);
|
|
137
135
|
return;
|
|
138
136
|
}
|
|
139
137
|
}
|
|
@@ -299,21 +297,12 @@ async function sendResult_forward(session, config, result, logger) {
|
|
|
299
297
|
// Step 6: 发送合并转发
|
|
300
298
|
if (!(session.onebot && session.onebot._request))
|
|
301
299
|
throw new Error("Onebot is not defined");
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
catch (e) {
|
|
313
|
-
if (e instanceof types_1.TimeoutError) {
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
throw e;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
300
|
+
await session.onebot._request('send_group_forward_msg', {
|
|
301
|
+
group_id: session.guildId,
|
|
302
|
+
messages: forwardNodes,
|
|
303
|
+
news: [{ text: result.description || '-' }, { text: '点击查看详情 | Powered by furryaxw' }],
|
|
304
|
+
prompt: result.title || '',
|
|
305
|
+
summary: '分享解析',
|
|
306
|
+
source: result.title || ''
|
|
307
|
+
});
|
|
319
308
|
}
|