From 230f4598e907a653c7dd28e9a15571e1563158e4 Mon Sep 17 00:00:00 2001 From: M SHAH Date: Tue, 14 Feb 2023 01:55:33 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20`getCommunityParticipantIds?= =?UTF-8?q?`=20#3024?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Client.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/api/Client.ts b/src/api/Client.ts index 0fc1cca762..b04239602a 100644 --- a/src/api/Client.ts +++ b/src/api/Client.ts @@ -180,6 +180,7 @@ declare module WAPI { ) => Promise; const getBusinessProfilesProducts: (to: string) => Promise; const getCommunityInfo: (groupId: string) => Promise; + const getCommunityParticipantIds: (groupId: string) => Promise; const postStatus: (text: string, params: any) => Promise; const deleteStatus: (statusesToDelete: string | string[]) => Promise; const sendImageWithProduct: (base64: string, to: string, caption: string, bizNumber: string, productId: string) => any; @@ -2589,6 +2590,25 @@ public async testCallback(callbackToTest: SimpleListener, testData: any) : Prom return await this.pup(messageId => WAPI.acceptGroupJoinRequest(messageId),messageId) } + /** + * Retrieves community members Ids + * @param communityId community id + */ + public async getCommunityParticipantIds(communityId: GroupChatId) : Promise<{ + id: GroupChatId, + participants: ContactId[], + subgroup: boolean + }[]>{ + return await this.pup( + communityId => WAPI.getCommunityParticipantIds(communityId), + communityId + ) as Promise<{ + id: GroupChatId, + participants: ContactId[], + subgroup: boolean + }[]>; + } + /** Joins a group via the invite link, code, or message * @param link This param is the string which includes the invite link or code. The following work: * - Follow this link to join my WA group: https://chat.whatsapp.com/DHTGJUfFJAV9MxOpZO1fBZ