Skip to content

Commit

Permalink
feat: Added getGroupMembershipRequests function
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed May 30, 2023
1 parent 9684395 commit bec03b1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/api/layers/group.layer.ts
Expand Up @@ -429,4 +429,26 @@ export class GroupLayer extends RetrieverLayer {
{ groupId, membershipIds }
);
}

/**
* Retrieve a list of a membership approval requests
* @category Group
* @param groupId Group ID ('000000-000000@g.us')
* @returns Promise
*/
public async getGroupMembershipRequests(groupId: string): Promise<
{
addedBy: Wid;
id: Wid;
parentGroupId?: Wid;
requestMethod: 'InviteLink' | 'LinkedGroupJoin' | 'NonAdminAdd';
t: number;
}[]
> {
return await evaluateAndReturn(
this.page,
({ groupId }) => WPP.group.getMembershipRequests(groupId),
{ groupId }
);
}
}

0 comments on commit bec03b1

Please sign in to comment.