Skip to content

Commit

Permalink
✨ feat: getCommunityAdmins
Browse files Browse the repository at this point in the history
  • Loading branch information
smashah committed Feb 13, 2023
1 parent 230f459 commit 2319ff5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/api/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ declare module WAPI {
) => Promise<boolean>;
const getBusinessProfilesProducts: (to: string) => Promise<any>;
const getCommunityInfo: (groupId: string) => Promise<any>;
const getCommunityAdmins: (groupId: string) => Promise<any>;
const getCommunityParticipantIds: (groupId: string) => Promise<any>;
const postStatus: (text: string, params: any) => Promise<any>;
const deleteStatus: (statusesToDelete: string | string[]) => Promise<any>;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2319ff5

Please sign in to comment.