Skip to content

Commit

Permalink
✨ feat: getCommunityInfo #3024
Browse files Browse the repository at this point in the history
  • Loading branch information
smashah committed Feb 13, 2023
1 parent 2120ea8 commit 6459605
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/api/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ declare module WAPI {
chatId: string
) => Promise<boolean>;
const getBusinessProfilesProducts: (to: string) => Promise<any>;
const getCommunityInfo: (groupId: string) => Promise<any>;
const postStatus: (text: string, params: any) => Promise<any>;
const deleteStatus: (statusesToDelete: string | string[]) => Promise<any>;
const sendImageWithProduct: (base64: string, to: string, caption: string, bizNumber: string, productId: string) => any;
Expand Down Expand Up @@ -2565,6 +2566,19 @@ public async testCallback(callbackToTest: SimpleListener, testData: any) : Prom
}


/**
* Returns the community metadata. Like group metadata but with a `subGroups` property which is the group metadata of the community subgroups.
* @param communityId community id
*/
public async getCommunityInfo(communityId: GroupChatId) : Promise<GroupMetadata & {
subGroups: GroupMetadata[]
}> {
return await this.pup(
communityId => WAPI.getCommunityInfo(communityId),
communityId
) as Promise<any>;
}

/**
*
* Accepts a request from a recipient to join a group. Takes the message ID of the request message.
Expand Down

0 comments on commit 6459605

Please sign in to comment.