From 55cae0e45f562cdc538e0d9689c302a879889c3e Mon Sep 17 00:00:00 2001 From: aliazhar Date: Sun, 3 Sep 2023 14:41:08 +0700 Subject: [PATCH] Feat: add authors who perform participant updates --- src/Types/Events.ts | 2 +- src/Utils/process-message.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Types/Events.ts b/src/Types/Events.ts index f37a6d2..291164f 100644 --- a/src/Types/Events.ts +++ b/src/Types/Events.ts @@ -50,7 +50,7 @@ export type BaileysEventMap = { 'groups.upsert': GroupMetadata[] 'groups.update': Partial[] /** apply an action to participants in a group */ - 'group-participants.update': { id: string, participants: string[], action: ParticipantAction } + 'group-participants.update': { id: string, author: string, participants: string[], action: ParticipantAction } 'blocklist.set': { blocklist: string[] } 'blocklist.update': { blocklist: string[], type: 'add' | 'remove' } diff --git a/src/Utils/process-message.ts b/src/Utils/process-message.ts index 294a63f..1088a14 100644 --- a/src/Utils/process-message.ts +++ b/src/Utils/process-message.ts @@ -279,7 +279,7 @@ const processMessage = async( //let actor = whatsappID (message.participant) let participants: string[] const emitParticipantsUpdate = (action: ParticipantAction) => ( - ev.emit('group-participants.update', { id: jid, participants, action }) + ev.emit('group-participants.update', { id: jid, author: message.participant!, participants, action }) ) const emitGroupUpdate = (update: Partial) => { ev.emit('groups.update', [{ id: jid, ...update }])