From 00c4688386c72e507325b046a16936250ac5e0ab Mon Sep 17 00:00:00 2001 From: Il Harper Date: Wed, 18 Sep 2024 11:29:35 +0800 Subject: [PATCH] fix(event): fix `guild-member-added` null `operator` field --- packages/engine-chronocat-event/src/parser/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/engine-chronocat-event/src/parser/index.ts b/packages/engine-chronocat-event/src/parser/index.ts index 825910e..d21feab 100644 --- a/packages/engine-chronocat-event/src/parser/index.ts +++ b/packages/engine-chronocat-event/src/parser/index.ts @@ -258,10 +258,12 @@ async function parseGuildMemberAddedMessage( ) event2.type = 'guild-member-added' - event2.operator = { - id: message.elements[0]!.grayTipElement!.groupElement!.adminUin!, - name: undefined as unknown as string, - } + // TODO: 自行入群大概率没有这个 adminUin 的,之后测下 + if (message.elements[0]!.grayTipElement!.groupElement!.adminUin) + event2.operator = { + id: message.elements[0]!.grayTipElement!.groupElement!.adminUin!, + name: undefined as unknown as string, + } event2.user = { id: message.elements[0]!.grayTipElement!.groupElement!.memberUin!,