Skip to content

Commit

Permalink
feat: Added WPP.group.getGroupSizeLimit function (close #691)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jan 28, 2023
1 parent 2352a54 commit 77a91fe
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/group/functions/getGroupSizeLimit.ts
@@ -0,0 +1,34 @@
/*!
* Copyright 2023 WPPConnect Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { functions } from '../../whatsapp';

/**
* Get the max number of participants for a group
*
* @example
* ```javascript
* const limit = await WPP.group.getGroupSizeLimit();
* console.log(limit);
* ```
*
* @category Group
*/
export async function getGroupSizeLimit() {
const limit = functions.getGroupSizeLimit();

return limit;
}
1 change: 1 addition & 0 deletions src/group/functions/index.ts
Expand Up @@ -25,6 +25,7 @@ export { ensureGroup } from './ensureGroup';
export { ensureGroupAndParticipants } from './ensureGroupAndParticipants';
export { getAllGroups } from './getAllGroups';
export { getGroupInfoFromInviteCode } from './getGroupInfoFromInviteCode';
export { getGroupSizeLimit } from './getGroupSizeLimit';
export { getInviteCode } from './getInviteCode';
export { getParticipants } from './getParticipants';
export { iAmAdmin } from './iAmAdmin';
Expand Down
30 changes: 30 additions & 0 deletions src/whatsapp/functions/getGroupSizeLimit.ts
@@ -0,0 +1,30 @@
/*!
* Copyright 2022 WPPConnect Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { exportModule } from '../exportModule';

/**
* @whatsapp 97858 >= 2.2304.7
*/
export declare function getGroupSizeLimit(groupType?: string): number;

exportModule(
exports,
{
getGroupSizeLimit: 'getGroupSizeLimit',
},
(m) => m.getGroupSizeLimit
);
1 change: 1 addition & 0 deletions src/whatsapp/functions/index.ts
Expand Up @@ -34,6 +34,7 @@ export * from './generateVideoThumbsAndDuration';
export * from './genMinimalLinkPreview';
export * from './getFanOutList';
export * from './getGroupSenderKeyList';
export * from './getGroupSizeLimit';
export * from './getHistorySyncProgress';
export * from './getQuotedMsgObj';
export * from './getReactions';
Expand Down

0 comments on commit 77a91fe

Please sign in to comment.