From 40948995b44f0831ab9e9d91ad92233ac05c9f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 3 Sep 2024 14:09:17 +0800 Subject: [PATCH] build: test --- src/onebot/action/msg/SendMsg.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/onebot/action/msg/SendMsg.ts b/src/onebot/action/msg/SendMsg.ts index bec021a4..c3c80509 100644 --- a/src/onebot/action/msg/SendMsg.ts +++ b/src/onebot/action/msg/SendMsg.ts @@ -173,9 +173,18 @@ export class SendMsg extends BaseAction { } const { sendElements } = await this.obContext.apis.MsgApi .createSendElements(OB11Data, destPeer); + //拆分消息 - const MixElement = sendElements.filter(element => element.elementType !== ElementType.FILE && element.elementType !== ElementType.VIDEO); - const SingleElement = sendElements.filter(element => element.elementType === ElementType.FILE || element.elementType === ElementType.VIDEO).map(e => [e]); + + const MixElement = sendElements.filter( + element => + element.elementType !== ElementType.FILE && element.elementType !== ElementType.VIDEO && element.elementType !== ElementType.ARK + ); + const SingleElement = sendElements.filter( + element => + element.elementType === ElementType.FILE || element.elementType === ElementType.VIDEO || element.elementType === ElementType.ARK + ).map(e => [e]); + const AllElement: SendMessageElement[][] = [MixElement, ...SingleElement].filter(e => e !== undefined && e.length !== 0); const MsgNodeList: Promise[] = []; for (const sendElementsSplitElement of AllElement) {