diff --git a/src/api/Client.ts b/src/api/Client.ts index b04239602a..4cec88dac6 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 getCommunityAdmins: (groupId: string) => Promise; const getCommunityParticipantIds: (groupId: string) => Promise; const postStatus: (text: string, params: any) => Promise; const deleteStatus: (statusesToDelete: string | string[]) => Promise; @@ -2609,6 +2610,26 @@ public async testCallback(callbackToTest: SimpleListener, testData: any) : Prom }[]>; } + + /** + * Retrieves community admins as Contact objects + * @param communityId community id + */ + public async getCommunityAdmins(communityId: GroupChatId) : Promise<{ + id: GroupChatId, + admins: Contact[], + subgroup: boolean + }[]>{ + return await this.pup( + communityId => WAPI.getCommunityAdmins(communityId), + communityId + ) as Promise<{ + id: GroupChatId, + admins: Contact[], + 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