koishi-plugin-best-cave 2.3.17 → 2.3.18
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 +4 -4
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -300,7 +300,7 @@ async function buildCaveMessage(cave, config, fileManager, logger2, platform, pr
|
|
|
300
300
|
const content = await transformToH(node.elements);
|
|
301
301
|
return (0, import_koishi.h)("message", {}, [author, ...content]);
|
|
302
302
|
}));
|
|
303
|
-
return (0, import_koishi.h)("
|
|
303
|
+
return (0, import_koishi.h)("message", { forward: true }, messageNodes);
|
|
304
304
|
} catch (error) {
|
|
305
305
|
logger2.warn(`解析回声洞(${cave.id})合并转发内容失败:`, error);
|
|
306
306
|
return import_koishi.h.text("[合并转发]");
|
|
@@ -332,7 +332,7 @@ async function buildCaveMessage(cave, config, fileManager, logger2, platform, pr
|
|
|
332
332
|
const footer = rawFooter ? rawFooter.replace(/\{id\}|\{name\}/g, (match) => replacements[match.slice(1, -1)]).trim() : "";
|
|
333
333
|
const problematicTypes = ["video", "audio", "file", "forward"];
|
|
334
334
|
const placeholderMap = { video: "[视频]", audio: "[音频]", file: "[文件]", forward: "[合并转发]" };
|
|
335
|
-
const containsProblematic = platform === "onebot" && caveHElements.some((el) => problematicTypes.includes(el.type));
|
|
335
|
+
const containsProblematic = platform === "onebot" && caveHElements.some((el) => problematicTypes.includes(el.type) || el.type === "message" && el.attrs.forward);
|
|
336
336
|
if (!containsProblematic) {
|
|
337
337
|
const finalMessage = [];
|
|
338
338
|
if (header) finalMessage.push(header + "\n");
|
|
@@ -343,8 +343,8 @@ async function buildCaveMessage(cave, config, fileManager, logger2, platform, pr
|
|
|
343
343
|
const initialMessageContent = [];
|
|
344
344
|
const followUpMessages = [];
|
|
345
345
|
for (const el of caveHElements) {
|
|
346
|
-
if (problematicTypes.includes(el.type)) {
|
|
347
|
-
initialMessageContent.push(import_koishi.h.text(placeholderMap[
|
|
346
|
+
if (problematicTypes.includes(el.type) || el.type === "message" && el.attrs.forward) {
|
|
347
|
+
initialMessageContent.push(import_koishi.h.text(placeholderMap["forward"]));
|
|
348
348
|
followUpMessages.push([el]);
|
|
349
349
|
} else {
|
|
350
350
|
initialMessageContent.push(el);
|