From 4c30cbf8ac9bf6972aca07bae3a4e10331a7af9b Mon Sep 17 00:00:00 2001 From: Shigma Date: Fri, 13 Oct 2023 22:35:58 +0800 Subject: [PATCH] fix(kook): add missing session.member --- adapters/kook/src/message.ts | 2 ++ adapters/kook/src/utils.ts | 3 +++ adapters/kook/src/ws.ts | 1 + 3 files changed, 6 insertions(+) diff --git a/adapters/kook/src/message.ts b/adapters/kook/src/message.ts index a44a4db2..cd2625ff 100644 --- a/adapters/kook/src/message.ts +++ b/adapters/kook/src/message.ts @@ -62,6 +62,8 @@ export class KookMessageEncoder extends MessageEncoder { }) const { url } = await this.bot.request('POST', '/asset/create', payload, payload.getHeaders()) return url + } else { + return attrs.url } } diff --git a/adapters/kook/src/utils.ts b/adapters/kook/src/utils.ts index 63255409..3093e815 100644 --- a/adapters/kook/src/utils.ts +++ b/adapters/kook/src/utils.ts @@ -129,6 +129,9 @@ function adaptMessageCreate(data: Kook.Data, meta: Kook.MessageExtra, session: P session.channelId = meta.code } session.event.channel.name = meta.channel_name + session.event.member = decodeGuildMember(data.extra.author) + session.event.user = session.event.member.user + delete session.event.member.user adaptMessageSession(data, meta, session.event.message = {}, session.event) } diff --git a/adapters/kook/src/ws.ts b/adapters/kook/src/ws.ts index 6b53a1b0..d60ef335 100644 --- a/adapters/kook/src/ws.ts +++ b/adapters/kook/src/ws.ts @@ -47,6 +47,7 @@ export class WsClient extends Adapter.WsClient