Skip to content

Commit

Permalink
feat: Added approveGroupMembershipRequest function
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed May 30, 2023
1 parent b093c53 commit 7b0e0e6
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/api/layers/group.layer.ts
Expand Up @@ -23,7 +23,7 @@ import {
fileToBase64,
downloadFileToBase64,
} from '../helpers';
import { Id } from '../model';
import { Id, Wid } from '../model';
import { GroupProperty } from '../model/enum';
import { RetrieverLayer } from './retriever.layer';

Expand Down Expand Up @@ -303,7 +303,7 @@ export class GroupLayer extends RetrieverLayer {
}

/**
* Set group subject (if allowed)
* Set group icon
* @category Group
* @param groupId Group ID ('000000-000000@g.us')
* @param base64 Image in base64 ( data:image/jpeg;base64,..... )
Expand Down Expand Up @@ -383,4 +383,27 @@ export class GroupLayer extends RetrieverLayer {
WPP.group.getGroupSizeLimit()
);
}

/**
* Approve a membership request to group
* @category Group
* @param groupId Group ID ('000000-000000@g.us')
* @param wid <number>@c.us
* @returns Promise
*/
public async approveGroupMembershipRequest(
groupId: string,
membershipIds: string | string[]
): Promise<
{
error: any;
wid: Wid;
}[]
> {
return await evaluateAndReturn(
this.page,
({ groupId, membershipIds }) => WPP.group.approve(groupId, membershipIds),
{ groupId, membershipIds }
);
}
}

0 comments on commit 7b0e0e6

Please sign in to comment.