@wppconnect/wa-js 2.18.3 → 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +4 -4
  3. package/dist/chat/events/eventTypes.d.ts +12 -1
  4. package/dist/chat/events/index.d.ts +2 -1
  5. package/dist/chat/events/registerActiveChatEvent.d.ts +16 -0
  6. package/dist/chat/functions/getActiveChat.d.ts +30 -0
  7. package/dist/chat/functions/index.d.ts +1 -0
  8. package/dist/community/functions/addSubgroups.d.ts +33 -0
  9. package/dist/community/functions/create.d.ts +27 -0
  10. package/dist/community/functions/deactivate.d.ts +27 -0
  11. package/dist/community/functions/demoteParticipants.d.ts +27 -0
  12. package/dist/community/functions/getParticipants.d.ts +27 -0
  13. package/dist/community/functions/index.d.ts +22 -0
  14. package/dist/community/functions/promoteParticipants.d.ts +27 -0
  15. package/dist/community/functions/removeSubgroups.d.ts +33 -0
  16. package/dist/community/index.d.ts +16 -0
  17. package/dist/conn/functions/getAuthCode.d.ts +6 -0
  18. package/dist/group/functions/demoteParticipants.d.ts +12 -0
  19. package/dist/group/functions/getAllGroups.d.ts +2 -0
  20. package/dist/group/functions/getGroupSizeLimit.d.ts +27 -0
  21. package/dist/group/functions/getInviteCode.d.ts +2 -0
  22. package/dist/group/functions/getParticipants.d.ts +2 -0
  23. package/dist/group/functions/index.d.ts +1 -0
  24. package/dist/group/functions/promoteParticipants.d.ts +14 -0
  25. package/dist/group/functions/removeParticipants.d.ts +14 -0
  26. package/dist/group/functions/setIcon.d.ts +2 -0
  27. package/dist/gtag/Tracker.d.ts +1 -0
  28. package/dist/index.d.ts +1 -0
  29. package/dist/whatsapp/functions/getCommunityParticipants.d.ts +20 -0
  30. package/dist/whatsapp/functions/getGroupSizeLimit.d.ts +19 -0
  31. package/dist/whatsapp/functions/groupParticipants.d.ts +6 -0
  32. package/dist/whatsapp/functions/index.d.ts +3 -0
  33. package/dist/whatsapp/functions/sendCreateCommunity.d.ts +44 -0
  34. package/dist/whatsapp/multidevice/adv.d.ts +1 -1
  35. package/dist/wppconnect-wa.js +1 -1
  36. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1 +1 @@
1
- ## 2.18.3 (2023-01-20)
1
+ # 2.19.0 (2023-01-31)
package/README.md CHANGED
@@ -5,9 +5,9 @@
5
5
  [![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/wppconnect-team/wa-js.svg)](https://isitmaintained.com/project/wppconnect/wa-js 'Average time to resolve an issue')
6
6
  [![Percentage of issues still open](https://isitmaintained.com/badge/open/wppconnect-team/wa-js.svg)](https://isitmaintained.com/project/wppconnect/wa-js 'Percentage of issues still open')
7
7
 
8
- [![Build Status](https://img.shields.io/github/workflow/status/wppconnect-team/wa-js/build.svg)](https://github.com/wppconnect-team/wa-js/actions/workflows/build.yml)
9
- [![Build Status](https://img.shields.io/github/workflow/status/wppconnect-team/wa-js/test.svg)](https://github.com/wppconnect-team/wa-js/actions/workflows/test.yml)
10
- [![Lint Status](https://img.shields.io/github/workflow/status/wppconnect-team/wa-js/lint.svg?label=lint)](https://github.com/wppconnect-team/wa-js/actions/workflows/lint.yml)
8
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/wppconnect-team/wa-js/build.yml?branch=main)](https://github.com/wppconnect-team/wa-js/actions/workflows/build.yml)
9
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/wppconnect-team/wa-js/test.yml?branch=main)](https://github.com/wppconnect-team/wa-js/actions/workflows/test.yml)
10
+ [![Lint Status](https://img.shields.io/github/actions/workflow/status/wppconnect-team/wa-js/lint.yml??branch=main&label=lint)](https://github.com/wppconnect-team/wa-js/actions/workflows/lint.yml)
11
11
  [![release-it](https://img.shields.io/badge/%F0%9F%93%A6%F0%9F%9A%80-release--it-e10079.svg)](https://github.com/release-it/release-it)
12
12
 
13
13
  > WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination...
@@ -16,7 +16,7 @@
16
16
 
17
17
  [![Discord](https://img.shields.io/discord/844351092758413353?color=blueviolet&label=Discord&logo=discord&style=flat)](https://discord.gg/JU5JGGKGNG)
18
18
  [![Telegram Group](https://img.shields.io/badge/Telegram-Group-32AFED?logo=telegram)](https://t.me/wppconnect)
19
- [![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/C1ChjyShl5cA7KvmtecF3L)
19
+ [![WhatsApp Group](https://img.shields.io/badge/WhatsApp-Group-25D366?logo=whatsapp)](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K)
20
20
  [![YouTube](https://img.shields.io/youtube/channel/subscribers/UCD7J9LG08PmGQrF5IS7Yv9A?label=YouTube)](https://www.youtube.com/c/wppconnect)
21
21
 
22
22
  ## How does it work
@@ -13,8 +13,19 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { MsgKey, MsgModel, Wid } from '../../whatsapp';
16
+ import { ChatModel, MsgKey, MsgModel, Wid } from '../../whatsapp';
17
17
  export interface ChatEventTypes {
18
+ /**
19
+ * Triggered when change the active chat
20
+ *
21
+ * @example
22
+ * ```javascript
23
+ * WPP.on('chat.active_chat', (chat) => {
24
+ * // Your code
25
+ * });
26
+ * ```
27
+ */
28
+ 'chat.active_chat': ChatModel;
18
29
  /**
19
30
  * Triggered when new message is received
20
31
  *
@@ -14,9 +14,10 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import './registerAckMessageEvent';
17
+ import './registerActiveChatEvent';
17
18
  import './registerLiveLocationUpdateEvent';
18
19
  import './registerNewMessageEvent';
19
20
  import './registerPollEvent';
20
21
  import './registerPresenceChange';
21
- import './registerRevokeMessageEvent';
22
22
  import './registerReactionsEvent';
23
+ import './registerRevokeMessageEvent';
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Copyright 2021 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Copyright 2021 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Return the current active chat
18
+ *
19
+ * @returns The currenct active chat or undefined for none
20
+ *
21
+ * @example
22
+ * ```javascript
23
+ * // Get active chat
24
+ * const chat = WPP.chat.getActiveChat();
25
+ *
26
+ * WPP.chat.sendTextMessage(chat.id, 'Hi');
27
+ * ```
28
+ * @category Chat
29
+ */
30
+ export declare function getActiveChat(): import("../../whatsapp").ChatModel | undefined;
@@ -26,6 +26,7 @@ export { find } from './find';
26
26
  export { forwardMessage, ForwardMessagesOptions } from './forwardMessage';
27
27
  export { generateMessageID } from './generateMessageID';
28
28
  export { get } from './get';
29
+ export { getActiveChat } from './getActiveChat';
29
30
  export { getLastSeen } from './getLastSeen';
30
31
  export { getMessageACK } from './getMessageACK';
31
32
  export { getMessageById } from './getMessageById';
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Add groups do community
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.community.addSubgroups('123456@g.us', ['123456@g.us', '123456@g.us']);
23
+ * ```
24
+ *
25
+ * @category Community
26
+ */
27
+ export declare function addSubgroups(parentGroupId: string | Wid, subgroupIds: (string | Wid) | (string | Wid)[]): Promise<{
28
+ failedGroups: {
29
+ error: string;
30
+ jid: string;
31
+ }[];
32
+ linkedGroupJids: string[];
33
+ }>;
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Create a community
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.community.create('Name for community', 'description for community', ['123456@g.us', '123456@g.us']);
23
+ * ```
24
+ *
25
+ * @category Community
26
+ */
27
+ export declare function create(name: string, desc: string, subGroupsIds: (string | Wid) | (string | Wid)[]): Promise<any>;
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Deactivated a community
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.community.deactivate('123456@g.us');
23
+ * ```
24
+ *
25
+ * @category Community
26
+ */
27
+ export declare function deactivate(communityId: string | Wid): Promise<any>;
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Remove admin of community participant
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.community.demoteParticipants('123456@g.us', '123456@c.us');
23
+ * ```
24
+ *
25
+ * @category Community
26
+ */
27
+ export declare function demoteParticipants(communityId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): Promise<any>;
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Get all participants of a community
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.community.getParticipants('123456@g.us');
23
+ * ```
24
+ *
25
+ * @category Community
26
+ */
27
+ export declare function getParticipants(communityId: string | Wid): Promise<any>;
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export { addSubgroups } from './addSubgroups';
17
+ export { create } from './create';
18
+ export { deactivate } from './deactivate';
19
+ export { demoteParticipants } from './demoteParticipants';
20
+ export { getParticipants } from './getParticipants';
21
+ export { promoteParticipants } from './promoteParticipants';
22
+ export { removeSubgroups } from './removeSubgroups';
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Promote participant of community to admin
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.community.promoteParticipants('123456@g.us', '123456@c.us');
23
+ * ```
24
+ *
25
+ * @category Community
26
+ */
27
+ export declare function promoteParticipants(communityId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): Promise<any>;
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Remove groups from community
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.community.sendUnlinkSubgroups('123456@g.us', ['123456@g.us', '123456@g.us']);
23
+ * ```
24
+ *
25
+ * @category Community
26
+ */
27
+ export declare function removeSubgroups(parentGroupId: string | Wid, subgroupIds: (string | Wid) | (string | Wid)[]): Promise<{
28
+ failedGroups: {
29
+ error: string;
30
+ jid: string;
31
+ }[];
32
+ linkedGroupJids: string[];
33
+ }>;
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export * from './functions';
@@ -17,6 +17,12 @@ import { AuthCode } from '..';
17
17
  /**
18
18
  * Return the current auth code
19
19
  *
20
+ * @example
21
+ * ```javascript
22
+ * const authCode = await WPP.conn.getAuthCode();
23
+ * console.log(authCode.fullCode); // Output: a long string to generate a QRCode
24
+ * ```
25
+ *
20
26
  * @return {Promise<AuthCode>}[return description]
21
27
  */
22
28
  export declare function getAuthCode(): Promise<AuthCode | null>;
@@ -14,4 +14,16 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Remove admin of a group
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * // One member
23
+ * await WPP.group.demoteParticipants('123456@g.us', '123456@c.us');
24
+ *
25
+ * // More than one member
26
+ * await WPP.group.demoteParticipants('123456@g.us', ['123456@c.us','123456@c.us']);
27
+ * ```
28
+ */
17
29
  export declare function demoteParticipants(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): Promise<void>;
@@ -20,5 +20,7 @@
20
20
  * ```javascript
21
21
  * WPP.group.queryAllGroups();
22
22
  * ```
23
+ *
24
+ * @category Group
23
25
  */
24
26
  export declare function getAllGroups(): Promise<(import("../../whatsapp").ChatModel | undefined)[]>;
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Get the max number of participants for a group
18
+ *
19
+ * @example
20
+ * ```javascript
21
+ * const limit = await WPP.group.getGroupSizeLimit();
22
+ * console.log(limit);
23
+ * ```
24
+ *
25
+ * @category Group
26
+ */
27
+ export declare function getGroupSizeLimit(): Promise<number>;
@@ -22,5 +22,7 @@ import { Wid } from '../../whatsapp';
22
22
  * const code = WPP.group.getInviteCode('[group-id]@g.us');
23
23
  * const link = 'https://chat.whatsapp.com/' + code;
24
24
  * ```
25
+ *
26
+ * @category Group
25
27
  */
26
28
  export declare function getInviteCode(groupId: string | Wid): Promise<string>;
@@ -21,5 +21,7 @@ import { Wid } from '../../whatsapp';
21
21
  * ```javascript
22
22
  * WPP.group.getParticipants('[group-id]@g.us');
23
23
  * ```
24
+ *
25
+ * @category Group
24
26
  */
25
27
  export declare function getParticipants(groupId: string | Wid): Promise<import("../../whatsapp").ParticipantModel[]>;
@@ -24,6 +24,7 @@ export { ensureGroup } from './ensureGroup';
24
24
  export { ensureGroupAndParticipants } from './ensureGroupAndParticipants';
25
25
  export { getAllGroups } from './getAllGroups';
26
26
  export { getGroupInfoFromInviteCode } from './getGroupInfoFromInviteCode';
27
+ export { getGroupSizeLimit } from './getGroupSizeLimit';
27
28
  export { getInviteCode } from './getInviteCode';
28
29
  export { getParticipants } from './getParticipants';
29
30
  export { iAmAdmin } from './iAmAdmin';
@@ -14,4 +14,18 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Promote group member to admin
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * // One member
23
+ * await WPP.group.promoteParticipants('123456@g.us', '123456@c.us');
24
+ *
25
+ * // More than one member
26
+ * await WPP.group.promoteParticipants('123456@g.us', ['123456@c.us','123456@c.us']);
27
+ * ```
28
+ *
29
+ * @category Group
30
+ */
17
31
  export declare function promoteParticipants(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): Promise<void>;
@@ -14,4 +14,18 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Remove participants of a group
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * // One member
23
+ * await WPP.group.removeParticipants('123456@g.us', '123456@c.us');
24
+ *
25
+ * // More than one member
26
+ * await WPP.group.removeParticipants('123456@g.us', ['123456@c.us','123456@c.us']);
27
+ * ```
28
+ *
29
+ * @category Group
30
+ */
17
31
  export declare function removeParticipants(groupId: string | Wid, participantsIds: (string | Wid) | (string | Wid)[]): Promise<void>;
@@ -21,6 +21,8 @@ import { Wid } from '../../whatsapp';
21
21
  * ```javascript
22
22
  * await WPP.group.setIcon('[group@g.us]', 'data:image/jpeg;base64,.....');
23
23
  * ```
24
+ *
25
+ * @category Group
24
26
  */
25
27
  export declare function setIcon(groupId: string | Wid, content: string): Promise<{
26
28
  eurl: string;
@@ -30,6 +30,7 @@ export declare class Tracker {
30
30
  private userProperties;
31
31
  private lastTime;
32
32
  private hitsCount;
33
+ documentTitle: string;
33
34
  constructor(trackingId: string);
34
35
  private get sid();
35
36
  private get sct();
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export * as chat from './chat';
27
27
  export * as conn from './conn';
28
28
  export * as contact from './contact';
29
29
  export * as ev from './eventEmitter';
30
+ export * as community from './community';
30
31
  export * as group from './group';
31
32
  export * as labels from './labels';
32
33
  export * as profile from './profile';
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../misc';
17
+ /**
18
+ * @whatsapp 673427
19
+ */
20
+ export declare function getCommunityParticipants(communityId: Wid): Promise<any>;
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * Copyright 2022 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * @whatsapp 97858 >= 2.2304.7
18
+ */
19
+ export declare function getGroupSizeLimit(groupType?: string): number;
@@ -34,3 +34,9 @@ export declare function promoteParticipants(group: ChatModel, participants: Part
34
34
  * @whatsapp 815562 >= 2.2228.4
35
35
  */
36
36
  export declare function demoteParticipants(group: ChatModel, participants: ParticipantModel[]): Promise<void>;
37
+ /** @whatsapp 688460
38
+ */
39
+ export declare function promoteCommunityParticipants(group: ChatModel, participants: ParticipantModel[]): Promise<void>;
40
+ /** @whatsapp 688460
41
+ */
42
+ export declare function demoteCommunityParticipants(group: ChatModel, participants: ParticipantModel[]): Promise<void>;
@@ -31,8 +31,10 @@ export * from './findChat';
31
31
  export * from './findFirstWebLink';
32
32
  export * from './generateVideoThumbsAndDuration';
33
33
  export * from './genMinimalLinkPreview';
34
+ export * from './getCommunityParticipants';
34
35
  export * from './getFanOutList';
35
36
  export * from './getGroupSenderKeyList';
37
+ export * from './getGroupSizeLimit';
36
38
  export * from './getHistorySyncProgress';
37
39
  export * from './getQuotedMsgObj';
38
40
  export * from './getReactions';
@@ -59,6 +61,7 @@ export * from './randomId';
59
61
  export * from './resetGroupInviteCode';
60
62
  export * from './sendCallSignalingMsg';
61
63
  export * from './sendClear';
64
+ export * from './sendCreateCommunity';
62
65
  export * from './sendCreateGroup';
63
66
  export * from './sendDelete';
64
67
  export * from './sendExitGroup';
@@ -0,0 +1,44 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../misc';
17
+ /**
18
+ * @whatsapp 650348
19
+ */
20
+ export declare function sendCreateCommunity(e: {
21
+ name: string;
22
+ desc: string;
23
+ closed: boolean;
24
+ }): Promise<any>;
25
+ /**
26
+ * @whatsapp 650348
27
+ */
28
+ export declare function sendDeactivateCommunity(e: {
29
+ parentGroupId: Wid;
30
+ }): Promise<any>;
31
+ /**
32
+ * @whatsapp 650348
33
+ */
34
+ export declare function sendLinkSubgroups(e: {
35
+ parentGroupId: Wid;
36
+ subgroupIds: Wid | Wid[];
37
+ }): Promise<any>;
38
+ /**
39
+ * @whatsapp 650348
40
+ */
41
+ export declare function sendUnlinkSubgroups(e: {
42
+ parentGroupId: Wid;
43
+ subgroupIds: Wid | Wid[];
44
+ }): Promise<any>;