mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-05 15:11:15 +00:00
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:
parent
eda1e5f2ed
commit
0b4264caef
@ -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 消息]';
|
||||
|
||||
@ -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: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user