@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.
- package/CHANGELOG.md +1 -1
- package/README.md +4 -4
- package/dist/chat/events/eventTypes.d.ts +12 -1
- package/dist/chat/events/index.d.ts +2 -1
- package/dist/chat/events/registerActiveChatEvent.d.ts +16 -0
- package/dist/chat/functions/getActiveChat.d.ts +30 -0
- package/dist/chat/functions/index.d.ts +1 -0
- package/dist/community/functions/addSubgroups.d.ts +33 -0
- package/dist/community/functions/create.d.ts +27 -0
- package/dist/community/functions/deactivate.d.ts +27 -0
- package/dist/community/functions/demoteParticipants.d.ts +27 -0
- package/dist/community/functions/getParticipants.d.ts +27 -0
- package/dist/community/functions/index.d.ts +22 -0
- package/dist/community/functions/promoteParticipants.d.ts +27 -0
- package/dist/community/functions/removeSubgroups.d.ts +33 -0
- package/dist/community/index.d.ts +16 -0
- package/dist/conn/functions/getAuthCode.d.ts +6 -0
- package/dist/group/functions/demoteParticipants.d.ts +12 -0
- package/dist/group/functions/getAllGroups.d.ts +2 -0
- package/dist/group/functions/getGroupSizeLimit.d.ts +27 -0
- package/dist/group/functions/getInviteCode.d.ts +2 -0
- package/dist/group/functions/getParticipants.d.ts +2 -0
- package/dist/group/functions/index.d.ts +1 -0
- package/dist/group/functions/promoteParticipants.d.ts +14 -0
- package/dist/group/functions/removeParticipants.d.ts +14 -0
- package/dist/group/functions/setIcon.d.ts +2 -0
- package/dist/gtag/Tracker.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/whatsapp/functions/getCommunityParticipants.d.ts +20 -0
- package/dist/whatsapp/functions/getGroupSizeLimit.d.ts +19 -0
- package/dist/whatsapp/functions/groupParticipants.d.ts +6 -0
- package/dist/whatsapp/functions/index.d.ts +3 -0
- package/dist/whatsapp/functions/sendCreateCommunity.d.ts +44 -0
- package/dist/whatsapp/multidevice/adv.d.ts +1 -1
- package/dist/wppconnect-wa.js +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
# 2.19.0 (2023-01-31)
|
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
[](https://isitmaintained.com/project/wppconnect/wa-js 'Average time to resolve an issue')
|
|
6
6
|
[](https://isitmaintained.com/project/wppconnect/wa-js 'Percentage of issues still open')
|
|
7
7
|
|
|
8
|
-
[](https://github.com/wppconnect-team/wa-js/actions/workflows/build.yml)
|
|
9
|
+
[](https://github.com/wppconnect-team/wa-js/actions/workflows/test.yml)
|
|
10
|
+
[](https://github.com/wppconnect-team/wa-js/actions/workflows/lint.yml)
|
|
11
11
|
[](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
|
[](https://discord.gg/JU5JGGKGNG)
|
|
18
18
|
[](https://t.me/wppconnect)
|
|
19
|
-
[](https://chat.whatsapp.com/
|
|
19
|
+
[](https://chat.whatsapp.com/LJaQu6ZyNvnBPNAVRbX00K)
|
|
20
20
|
[](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>;
|
|
@@ -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;
|
package/dist/gtag/Tracker.d.ts
CHANGED
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>;
|