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:
手瓜一十雪 2026-01-24 12:28:52 +08:00
parent 19766002ae
commit 679c980683
2 changed files with 2 additions and 3 deletions

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 消息]';

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: {