@open-wa/wa-automate-types-only 4.58.0 → 4.61.0
Sign up to get free protection for your applications and to get access to all the features.
package/dist/api/Client.d.ts
CHANGED
@@ -328,6 +328,14 @@ export declare class Client {
|
|
328
328
|
* @returns `true` if the callback was registered
|
329
329
|
*/
|
330
330
|
onGlobalParticipantsChanged(fn: (participantChangedEvent: ParticipantChangedEventModel) => void): Promise<Listener | boolean>;
|
331
|
+
/**
|
332
|
+
* Listents to group approval requests. Emits a message object. Use it with `message.isGroupApprovalRequest()` to check if it is a group approval request.
|
333
|
+
*
|
334
|
+
* @event
|
335
|
+
* @param fn callback function that handles a [[Message]] as the first and only parameter.
|
336
|
+
* @returns `true` if the callback was registered
|
337
|
+
*/
|
338
|
+
onGroupApprovalRequest(fn: (groupApprovalRequestMessage: Message) => void): Promise<Listener | boolean>;
|
331
339
|
/**
|
332
340
|
* Listens to all group (gp2) events. This can be useful if you want to catch when a group title, subject or picture is changed.
|
333
341
|
*
|
@@ -517,6 +525,15 @@ export declare class Client {
|
|
517
525
|
*/
|
518
526
|
forceUpdateLiveLocation(chatId: ChatId): Promise<LiveLocationChangedEvent[] | boolean>;
|
519
527
|
/**
|
528
|
+
*
|
529
|
+
* @deprecated
|
530
|
+
*
|
531
|
+
* :::danger
|
532
|
+
*
|
533
|
+
* Buttons are broken for the foreseeable future. Please DO NOT get a license solely for access to buttons. They are no longer reliable due to recent changes at WA.
|
534
|
+
*
|
535
|
+
* :::
|
536
|
+
*
|
520
537
|
* Test the button commands on MD accounts with an insiders key. This is a temporary feature to help fix issue #2658
|
521
538
|
*/
|
522
539
|
testButtons(chatId: ChatId): Promise<any>;
|
@@ -570,7 +587,14 @@ export declare class Client {
|
|
570
587
|
*/
|
571
588
|
sendPaymentRequest(to: ChatId, amount: number, currency: string, message?: string): Promise<boolean | MessageId>;
|
572
589
|
/**
|
573
|
-
*
|
590
|
+
*
|
591
|
+
* @deprecated
|
592
|
+
*
|
593
|
+
* :::danger
|
594
|
+
*
|
595
|
+
* Buttons are broken for the foreseeable future. Please DO NOT get a license solely for access to buttons. They are no longer reliable due to recent changes at WA.
|
596
|
+
*
|
597
|
+
* :::
|
574
598
|
*
|
575
599
|
* Send generic quick reply buttons. This is an insiders feature for MD accounts.
|
576
600
|
*
|
@@ -582,16 +606,17 @@ export declare class Client {
|
|
582
606
|
*/
|
583
607
|
sendButtons(to: ChatId, body: string | LocationButtonBody, buttons: Button[], title?: string, footer?: string): Promise<boolean | MessageId>;
|
584
608
|
/**
|
585
|
-
* {@license:insiders@}
|
586
609
|
*
|
587
|
-
*
|
610
|
+
* @deprecated
|
588
611
|
*
|
589
|
-
* :::
|
612
|
+
* :::danger
|
590
613
|
*
|
591
|
-
*
|
614
|
+
* Buttons are broken for the foreseeable future. Please DO NOT get a license solely for access to buttons. They are no longer reliable due to recent changes at WA.
|
592
615
|
*
|
593
616
|
* :::
|
594
617
|
*
|
618
|
+
* Send advanced buttons with media body. This is an insiders feature for MD accounts.
|
619
|
+
*
|
595
620
|
* Body can be location, image, video or document. Buttons can be quick reply, url or call buttons.
|
596
621
|
*
|
597
622
|
* @param {ChatId} to chat id
|
@@ -612,7 +637,14 @@ export declare class Client {
|
|
612
637
|
*/
|
613
638
|
sendBanner(to: ChatId, base64: Base64): Promise<boolean | MessageId>;
|
614
639
|
/**
|
615
|
-
*
|
640
|
+
* @deprecated
|
641
|
+
*
|
642
|
+
*
|
643
|
+
* :::danger
|
644
|
+
*
|
645
|
+
* Buttons are broken for the foreseeable future. Please DO NOT get a license solely for access to buttons. They are no longer reliable due to recent changes at WA.
|
646
|
+
*
|
647
|
+
* :::
|
616
648
|
*
|
617
649
|
* Send a list message. This will not work when being sent from business accounts!
|
618
650
|
*
|
@@ -1391,6 +1423,12 @@ export declare class Client {
|
|
1391
1423
|
*
|
1392
1424
|
* {@license:insiders@}
|
1393
1425
|
*
|
1426
|
+
* :::danger
|
1427
|
+
*
|
1428
|
+
* Buttons are broken for the foreseeable future. Please DO NOT get a license solely for access to buttons. They are no longer reliable due to recent changes at WA.
|
1429
|
+
*
|
1430
|
+
* :::
|
1431
|
+
*
|
1394
1432
|
* Use a raw payload within your open-wa session
|
1395
1433
|
*
|
1396
1434
|
* @param chatId
|
@@ -1443,6 +1481,26 @@ export declare class Client {
|
|
1443
1481
|
* @returns `Promise<boolean>`
|
1444
1482
|
*/
|
1445
1483
|
revokeGroupInviteLink(chatId: ChatId): Promise<boolean | string>;
|
1484
|
+
/**
|
1485
|
+
* Gets the contact IDs of members requesting approval to join the group
|
1486
|
+
* @param groupChatId
|
1487
|
+
* @returns `Promise<ContactId[]>`
|
1488
|
+
*/
|
1489
|
+
getGroupApprovalRequests(groupChatId: GroupChatId): Promise<ContactId[]>;
|
1490
|
+
/**
|
1491
|
+
* Approves a group join request
|
1492
|
+
* @param groupChatId The group chat id
|
1493
|
+
* @param contactId The contact id of the person who is requesting to join the group
|
1494
|
+
* @returns `Promise<boolean>`
|
1495
|
+
*/
|
1496
|
+
approveGroupJoinRequest(groupChatId: GroupChatId, contactId: ContactId): Promise<boolean | string>;
|
1497
|
+
/**
|
1498
|
+
* Rejects a group join request
|
1499
|
+
* @param groupChatId The group chat id
|
1500
|
+
* @param contactId The contact id of the person who is requesting to join the group
|
1501
|
+
* @returns `Promise<boolean>`
|
1502
|
+
*/
|
1503
|
+
rejectGroupJoinRequest(groupChatId: GroupChatId, contactId: ContactId): Promise<boolean | string>;
|
1446
1504
|
/**
|
1447
1505
|
* Deletes message of given message id
|
1448
1506
|
* @param chatId The chat id from which to delete the message.
|
@@ -1622,6 +1680,14 @@ export declare class Client {
|
|
1622
1680
|
* @returns boolean true if action completed successfully.
|
1623
1681
|
*/
|
1624
1682
|
setGroupEditToAdminsOnly(groupId: GroupChatId, onlyAdmins: boolean): Promise<boolean>;
|
1683
|
+
/**
|
1684
|
+
*
|
1685
|
+
* Turn on or off the approval requirement for new members to join a group
|
1686
|
+
* @param groupId '0000000000-00000000@g.us' the group id.
|
1687
|
+
* @param requireApproval set to true to turn on the approval requirement, false to turn off
|
1688
|
+
* @returns boolean true if action completed successfully.
|
1689
|
+
*/
|
1690
|
+
setGroupApprovalMode(groupId: GroupChatId, requireApproval: boolean): Promise<boolean>;
|
1625
1691
|
/**
|
1626
1692
|
* Change the group chant description
|
1627
1693
|
* @param groupId '0000000000-00000000@g.us' the group id.
|
package/dist/api/model/chat.d.ts
CHANGED
@@ -84,6 +84,10 @@ export interface BaseChat {
|
|
84
84
|
* @deprecated This is unreliable. Use the method [`getLastSeen`](https://open-wa.github.io/wa-automate-nodejs/classes/client.html#getlastseen) instead.
|
85
85
|
*/
|
86
86
|
lastSeen?: any;
|
87
|
+
/**
|
88
|
+
* URL of the chat picture if available
|
89
|
+
*/
|
90
|
+
pic?: string;
|
87
91
|
}
|
88
92
|
export interface SingleChat extends BaseChat {
|
89
93
|
/**
|
@@ -46,6 +46,10 @@ export declare enum SimpleListener {
|
|
46
46
|
* Represents [[onGlobalParticipantsChanged]]
|
47
47
|
*/
|
48
48
|
GlobalParticipantsChanged = "onGlobalParticipantsChanged",
|
49
|
+
/**
|
50
|
+
* Represents [[onGroupApprovalRequest]]
|
51
|
+
*/
|
52
|
+
GroupApprovalRequest = "onGroupApprovalRequest",
|
49
53
|
/**
|
50
54
|
* Represents [[onChatState]]
|
51
55
|
*/
|
package/dist/utils/tools.d.ts
CHANGED
@@ -142,3 +142,11 @@ export declare const pathExists: (_path: string, failSilent?: boolean) => Promis
|
|
142
142
|
* @returns string
|
143
143
|
*/
|
144
144
|
export declare const fixPath: (_path: string) => string;
|
145
|
+
/**
|
146
|
+
*
|
147
|
+
* Accented filenames break file sending in docker containers. This is used to replace accented chars in strings to prevent file sending failures.
|
148
|
+
*
|
149
|
+
* @param input The raw string
|
150
|
+
* @returns A sanitized string with all accented chars removed
|
151
|
+
*/
|
152
|
+
export declare const sanitizeAccentedChars: (input: string) => string;
|