From e91e054f20f9f03c9df31e89ee9dd71bc8186c79 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: Thu, 29 Aug 2024 00:10:29 +0800 Subject: [PATCH] refactor: GetGroupEssence --- src/onebot/action/group/GetGroupEssence.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/onebot/action/group/GetGroupEssence.ts b/src/onebot/action/group/GetGroupEssence.ts index cd38c20e..8754ce17 100644 --- a/src/onebot/action/group/GetGroupEssence.ts +++ b/src/onebot/action/group/GetGroupEssence.ts @@ -38,12 +38,14 @@ export class GetGroupEssence extends BaseAction { let handledMsg: any[] = []; for (let msg of msgs) { switch (msg.msg_type) { - case 2: + case 1: handledMsg.push(await this.parseEssenceMsgText(msg)); break; case 3: handledMsg.push(await this.parseEssenceMsgImage(msg)); break; + default: + break; } } return handledMsg; @@ -85,7 +87,7 @@ export class GetGroupEssence extends BaseAction { operator_nick: msg.add_digest_nick, message_id: message_id, operator_time: msg.add_digest_time, - content: await this.obContext.apis.MsgApi.parseMessage(rawMessage, 'array') + content: (await this.obContext.apis.MsgApi.parseMessage(rawMessage, 'array'))?.message }; } const msgTempData = JSON.stringify({