Skip to content

Commit

Permalink
feat: Added new functions to groups
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Apr 29, 2023
1 parent 9d1c959 commit 01cb169
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/api/layers/group.layer.ts
Expand Up @@ -355,4 +355,32 @@ export class GroupLayer extends RetrieverLayer {
{ groupId, base64 }
);
}
/**
* Set group subject (if allowed)
* @category Group
* @param groupId Group ID ('0000000000@g.us')
* @returns empty object
*/
public async removeGroupIcon(groupId: string) {
if (!groupId) {
throw new Error('Empty or invalid group id');
}

return await evaluateAndReturn(
this.page,
({ groupId }) => WPP.group.removeIcon(groupId),
{ groupId }
);
}

/**
* Get the max number of participants for a group
* @category Group
* @returns number
*/
public async getGroupSizeLimit() {
return await evaluateAndReturn(this.page, () =>
WPP.group.getGroupSizeLimit()
);
}
}

0 comments on commit 01cb169

Please sign in to comment.