Refine markdown element handling in message parsing

Simplified the condition for returning markdown summaries in log.ts and improved the check for flash transfer info in msg.ts to ensure filesetId exists. This enhances message parsing reliability for markdown and flash transfer messages.
This commit is contained in:
手瓜一十雪 committed 2026-01-24 12:28:52 +08:00
1 parent eda1e5f2ed
commit 0b4264caef
2 files changed
+2 -3

No files matched your search

+1 -2
View File
@@ -294,8 +294,7 @@ function msgElementToText (element: MessageElement, msg: RawMessage, recursiveLe
}
if (element.markdownElement) {
// console.log(element.markdownElement);
if (element.markdownElement.mdSummary !== undefined && element.markdownElement.mdExtInfo !== undefined && element.markdownElement.mdExtInfo.flashTransferInfo) {
if (element.markdownElement?.mdSummary) {
return element.markdownElement.mdSummary;
} else {
return '[Markdown 消息]';
+1 -1
View File
@@ -561,7 +561,7 @@ export class OneBotMsgApi {
markdownElement: async (element) => {
// 让QQ闪传消息独立出去
if (element.mdExtInfo !== undefined && element.mdExtInfo.flashTransferInfo) {
if (element.mdExtInfo !== undefined && element?.mdExtInfo?.flashTransferInfo?.filesetId) {
return {
type: OB11MessageDataType.flashtransfer,
data: {