koishi-plugin-share-links-analysis 0.6.0 → 0.6.2
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/utils.js +7 -7
- package/package.json +1 -1
package/lib/utils.js
CHANGED
|
@@ -271,7 +271,7 @@ async function tryGetRequestForSize(url, proxy, userAgent, logger) {
|
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
273
|
async function getEffectiveSettings(ctx, guildId, config) {
|
|
274
|
-
if (guildId
|
|
274
|
+
if (guildId == undefined) {
|
|
275
275
|
return {
|
|
276
276
|
parsers: config.default_parsers,
|
|
277
277
|
nsfw: config.allow_sensitive
|
|
@@ -392,7 +392,7 @@ async function sendResult_plain(session, config, result, logger) {
|
|
|
392
392
|
if (config.logLevel !== 'none') {
|
|
393
393
|
const sizeMB = (sizeBytes / (1024 * 1024)).toFixed(2);
|
|
394
394
|
const maxMB = config.Max_size.toFixed(2);
|
|
395
|
-
sendPromises.push(session.send(`文件大小超限 (${sizeMB} MB > ${maxMB} MB)`));
|
|
395
|
+
sendPromises.push(session.send(`文件大小超限 (${sizeMB} MB > ${maxMB} MB)\n视频直连${remoteUrl}`));
|
|
396
396
|
logger.info(`文件大小超限 (${sizeMB} MB > ${maxMB} MB),跳过: ${remoteUrl}`);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
@@ -477,10 +477,10 @@ async function sendResult_forward(session, config, result, logger, mixed_sending
|
|
|
477
477
|
}
|
|
478
478
|
// === 主消息(不含媒体文件)===
|
|
479
479
|
let message = config.format;
|
|
480
|
-
message = message.replace(/{title}/g,
|
|
481
|
-
message = message.replace(/{authorName}/g,
|
|
482
|
-
message = message.replace(/{sourceUrl}/g,
|
|
483
|
-
message = message.replace(/{stats}/g,
|
|
480
|
+
message = message.replace(/{title}/g, result.title || '');
|
|
481
|
+
message = message.replace(/{authorName}/g, result.authorName || '');
|
|
482
|
+
message = message.replace(/{sourceUrl}/g, result.sourceUrl || '');
|
|
483
|
+
message = message.replace(/{stats}/g, result.stats || '');
|
|
484
484
|
const lines = message.split('\n').filter(line => line.trim() !== '');
|
|
485
485
|
const mainSegments = [];
|
|
486
486
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -546,7 +546,7 @@ async function sendResult_forward(session, config, result, logger, mixed_sending
|
|
|
546
546
|
nickname: '分享助手',
|
|
547
547
|
content: {
|
|
548
548
|
type: 'text', data: {
|
|
549
|
-
text: `文件大小超限 (${sizeMB} MB > ${maxMB} MB)`
|
|
549
|
+
text: `文件大小超限 (${sizeMB} MB > ${maxMB} MB)\n视频直连${remoteUrl}`
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
}
|