@open-wa/wa-automate 4.43.2 → 4.43.5

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.
@@ -39,6 +39,7 @@ export declare class Client {
39
39
  private _page;
40
40
  private _currentlyBeingKilled;
41
41
  private _refreshing;
42
+ private _loaded;
42
43
  private _prio;
43
44
  private _pageListeners;
44
45
  private _registeredPageListeners;
@@ -244,19 +245,19 @@ export declare class Client {
244
245
  */
245
246
  onLabel(fn: (label: Label) => void): Promise<Listener | boolean>;
246
247
  /**
247
- *[REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
248
+ *{@license:insiders@}
248
249
  *
249
250
  * Listens to new orders. Only works on business accounts
250
251
  */
251
252
  onOrder(fn: (order: Order) => void): Promise<Listener | boolean>;
252
253
  /**
253
- *[REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
254
+ *{@license:insiders@}
254
255
  *
255
256
  * Listens to new orders. Only works on business accounts
256
257
  */
257
258
  onNewProduct(fn: (product: Product) => void): Promise<Listener | boolean>;
258
259
  /**
259
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
260
+ * {@license:insiders@}
260
261
  *
261
262
  * Listens to reaction add and change events
262
263
  *
@@ -266,7 +267,7 @@ export declare class Client {
266
267
  */
267
268
  onReaction(fn: (reactionEvent: ReactionEvent) => void): Promise<Listener | boolean>;
268
269
  /**
269
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
270
+ * {@license:insiders@}
270
271
  *
271
272
  * Listens to chat state, including when a specific user is recording and typing within a group chat.
272
273
  *
@@ -309,7 +310,7 @@ export declare class Client {
309
310
  */
310
311
  onAddedToGroup(fn: (chat: Chat) => any): Promise<Listener | boolean>;
311
312
  /**
312
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
313
+ * {@license:insiders@}
313
314
  *
314
315
  * Fires callback with Chat object every time the host phone is removed to a group.
315
316
  *
@@ -319,7 +320,7 @@ export declare class Client {
319
320
  */
320
321
  onRemovedFromGroup(fn: (chat: Chat) => any): Promise<Listener | boolean>;
321
322
  /**
322
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
323
+ * {@license:insiders@}
323
324
  *
324
325
  * Fires callback with the relevant chat id every time the user clicks on a chat. This will only work in headful mode.
325
326
  *
@@ -329,7 +330,7 @@ export declare class Client {
329
330
  */
330
331
  onChatOpened(fn: (chat: Chat) => any): Promise<Listener | boolean>;
331
332
  /**
332
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
333
+ * {@license:insiders@}
333
334
  *
334
335
  * Fires callback with contact id when a new contact is added on the host phone.
335
336
  *
@@ -373,7 +374,7 @@ export declare class Client {
373
374
  */
374
375
  setMyStatus(newStatus: string): Promise<boolean | void>;
375
376
  /**
376
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
377
+ * {@license:insiders@}
377
378
  *
378
379
  * Adds label from chat, message or contact. Only for business accounts.
379
380
  * @param label: The desired text of the new label. id will be something simple like anhy nnumber from 1-10, name is the label of the label if that makes sense.
@@ -486,8 +487,13 @@ export declare class Client {
486
487
  testButtons(chatId: ChatId): Promise<any>;
487
488
  private link;
488
489
  /**
490
+ *
491
+ * {@license:restricted@}
492
+ *
489
493
  * Sends a text message to given chat
490
- * If you need to send a message to new numbers please see [these instructions:](https://docs.openwa.dev/pages/The%20Client/licensed-features.html#sending-messages-to-non-contact-numbers)
494
+ *
495
+ * A license is **NOT** required to send messages with existing chats/contacts. A license is only required for starting conversations with new numbers.
496
+ *
491
497
  * @param to chat id: `xxxxx@c.us`
492
498
  * @param content text message
493
499
  */
@@ -515,6 +521,8 @@ export declare class Client {
515
521
  */
516
522
  sendPaymentRequest(to: ChatId, amount: number, currency: string, message?: string): Promise<boolean | MessageId>;
517
523
  /**
524
+ * {@license:insiders@}
525
+ *
518
526
  * Send generic quick reply buttons. This is an insiders feature for MD accounts.
519
527
  *
520
528
  * @param {ChatId} to chat id
@@ -551,8 +559,6 @@ export declare class Client {
551
559
  /**
552
560
  * {@license:insiders@}
553
561
  *
554
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
555
- *
556
562
  * Send a list message. This will not work when being sent from business accounts!
557
563
  *
558
564
  * @param {ChatId} to
@@ -575,7 +581,7 @@ export declare class Client {
575
581
  */
576
582
  sendReplyWithMentions(to: ChatId, content: Content, replyMessageId: MessageId, hideTags?: boolean, mentions?: ContactId[]): Promise<boolean | MessageId>;
577
583
  /**
578
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
584
+ * {@license:insiders@}
579
585
  *
580
586
  * Tags everyone in the group with a message
581
587
  *
@@ -660,7 +666,7 @@ export declare class Client {
660
666
  */
661
667
  reply(to: ChatId, content: Content, quotedMsgId: MessageId, sendSeen?: boolean): Promise<boolean | MessageId>;
662
668
  /**
663
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
669
+ * {@license:insiders@}
664
670
  *
665
671
  * Check if a recipient has read receipts on.
666
672
  *
@@ -692,7 +698,7 @@ export declare class Client {
692
698
  */
693
699
  sendFile(to: ChatId, file: DataURL | FilePath, filename: string, caption: Content, quotedMsgId?: MessageId, waitForId?: boolean, ptt?: boolean, withoutPreview?: boolean, hideTags?: boolean, viewOnce?: boolean): Promise<MessageId | boolean>;
694
700
  /**
695
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
701
+ * {@license:insiders@}
696
702
  *
697
703
  * Checks whether or not the group id provided is known to be unsafe by the contributors of the library.
698
704
  * @param groupChatId The group chat you want to deteremine is unsafe
@@ -812,7 +818,7 @@ export declare class Client {
812
818
  sendContact(to: ChatId, contactId: ContactId | ContactId[]): Promise<MessageId | boolean>;
813
819
  /**
814
820
  *
815
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
821
+ * {@license:insiders@}
816
822
  *
817
823
  * Sends multiple contacts as a single message
818
824
  *
@@ -848,7 +854,7 @@ export declare class Client {
848
854
  pinChat(id: ChatId, pin: boolean): Promise<boolean>;
849
855
  /**
850
856
  *
851
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
857
+ * {@license:insiders@}
852
858
  *
853
859
  * Mutes a conversation for a given duration. If already muted, this will update the muted duration. Mute durations are relative from when the method is called.
854
860
  * @param chatId The id of the conversation you want to mute
@@ -864,7 +870,7 @@ export declare class Client {
864
870
  isChatMuted(chatId: ChatId): Promise<boolean>;
865
871
  /**
866
872
  *
867
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
873
+ * {@license:insiders@}
868
874
  *
869
875
  * Unmutes a conversation.
870
876
  * @param id The id of the conversation you want to mute
@@ -1000,9 +1006,9 @@ export declare class Client {
1000
1006
  */
1001
1007
  contactBlock(id: ContactId): Promise<boolean>;
1002
1008
  /**
1003
- * Report a contact for spam, block them and attempt to clear chat.
1009
+ * {@license:restricted@}
1004
1010
  *
1005
- * [This is a restricted feature and requires a restricted key.](https://gum.co/open-wa?tier=1%20Restricted%20License%20Key)
1011
+ * Report a contact for spam, block them and attempt to clear chat.
1006
1012
  *
1007
1013
  * @param {string} id '000000000000@c.us'
1008
1014
  */
@@ -1058,14 +1064,14 @@ export declare class Client {
1058
1064
  */
1059
1065
  getMessageById(messageId: MessageId): Promise<Message>;
1060
1066
  /**
1061
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1067
+ * {@license:insiders@}
1062
1068
  *
1063
1069
  * Get the detailed message info for a group message sent out by the host account.
1064
1070
  * @param messageId The message Id
1065
1071
  */
1066
1072
  getMessageInfo(messageId: MessageId): Promise<MessageInfo>;
1067
1073
  /**
1068
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1074
+ * {@license:insiders@}
1069
1075
  *
1070
1076
  * Retrieves an order object
1071
1077
  * @param messageId or OrderId
@@ -1073,7 +1079,7 @@ export declare class Client {
1073
1079
  */
1074
1080
  getOrder(id: MessageId | string): Promise<Order>;
1075
1081
  /**
1076
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1082
+ * {@license:insiders@}
1077
1083
  *
1078
1084
  * Add a product to your catalog
1079
1085
  *
@@ -1089,7 +1095,7 @@ export declare class Client {
1089
1095
  */
1090
1096
  createNewProduct(name: string, price: number, currency: string, images: string[], description: string, url?: string, internalId?: string, isHidden?: boolean): Promise<Product>;
1091
1097
  /**
1092
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1098
+ * {@license:insiders@}
1093
1099
  *
1094
1100
  * Edit a product in your catalog
1095
1101
  *
@@ -1106,7 +1112,7 @@ export declare class Client {
1106
1112
  */
1107
1113
  editProduct(productId: string, name?: string, price?: number, currency?: string, images?: DataURL[], description?: string, url?: string, internalId?: string, isHidden?: boolean): Promise<Product>;
1108
1114
  /**
1109
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1115
+ * {@license:insiders@}
1110
1116
  *
1111
1117
  * Send a product to a chat
1112
1118
  *
@@ -1126,9 +1132,9 @@ export declare class Client {
1126
1132
  /**
1127
1133
  * Retrieves the last message sent by the host account in any given chat or globally.
1128
1134
  * @param chatId This is optional. If no chat Id is set then the last message sent by the host account will be returned.
1129
- * @returns message object
1135
+ * @returns message object or `undefined` if the host account's last message could not be found.
1130
1136
  */
1131
- getMyLastMessage(chatId?: ChatId): Promise<Message>;
1137
+ getMyLastMessage(chatId?: ChatId): Promise<Message | undefined>;
1132
1138
  /**
1133
1139
  * Retrieves the starred messages in a given chat
1134
1140
  * @param chatId Chat ID to filter starred messages by
@@ -1167,7 +1173,7 @@ export declare class Client {
1167
1173
  getStickerDecryptable(messageId: MessageId): Promise<Message | false>;
1168
1174
  /**
1169
1175
  *
1170
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1176
+ * {@license:insiders@}
1171
1177
  *
1172
1178
  * If a file is old enough, it will 404 if you try to decrypt it. This will allow you to force the host account to re upload the file and return a decryptable message.
1173
1179
  *
@@ -1184,7 +1190,7 @@ export declare class Client {
1184
1190
  */
1185
1191
  getChat(contactId: ContactId): Promise<Chat>;
1186
1192
  /**
1187
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1193
+ * {@license:insiders@}
1188
1194
  *
1189
1195
  * Retrieves the groups that you have in common with a contact
1190
1196
  * @param contactId
@@ -1252,9 +1258,9 @@ export declare class Client {
1252
1258
  }>;
1253
1259
  /**
1254
1260
  *
1255
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1261
+ * {@license:insiders@}
1256
1262
  *
1257
- * Use a Baileys payload within your open-wa session
1263
+ * Use a raw payload within your open-wa session
1258
1264
  *
1259
1265
  * @param chatId
1260
1266
  * @param payload {any}
@@ -1481,7 +1487,7 @@ export declare class Client {
1481
1487
  */
1482
1488
  setGroupDescription(groupId: GroupChatId, description: string): Promise<boolean>;
1483
1489
  /**
1484
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1490
+ * {@license:insiders@}
1485
1491
  *
1486
1492
  * Change the group chat title
1487
1493
  * @param groupId '0000000000-00000000@g.us' the group id.
@@ -1495,7 +1501,7 @@ export declare class Client {
1495
1501
  */
1496
1502
  getGroupAdmins(groupId: GroupChatId): Promise<ContactId[]>;
1497
1503
  /**
1498
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1504
+ * {@license:insiders@}
1499
1505
  *
1500
1506
  * Set the wallpaper background colour
1501
1507
  * @param {string} hex '#FFF123'
@@ -1532,7 +1538,7 @@ export declare class Client {
1532
1538
  */
1533
1539
  sendStickerfromUrl(to: ChatId, url: string, requestConfig?: AxiosRequestConfig, stickerMetadata?: StickerMetadata): Promise<string | MessageId | boolean>;
1534
1540
  /**
1535
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1541
+ * {@license:insiders@}
1536
1542
  *
1537
1543
  * Sends a sticker from a given URL
1538
1544
  * @param to The recipient id.
@@ -1544,7 +1550,7 @@ export declare class Client {
1544
1550
  */
1545
1551
  sendStickerfromUrlAsReply(to: ChatId, url: string, messageId: MessageId, requestConfig?: AxiosRequestConfig, stickerMetadata?: StickerMetadata): Promise<MessageId | boolean>;
1546
1552
  /**
1547
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1553
+ * {@license:insiders@}
1548
1554
  *
1549
1555
  * This function takes an image and sends it as a sticker to the recipient as a reply to another message.
1550
1556
  *
@@ -1583,7 +1589,7 @@ export declare class Client {
1583
1589
  *
1584
1590
  * @param to ChatId The chat id you want to send the webp sticker to
1585
1591
  * @param file [[DataURL]], [[Base64]], URL (string GET), Relative filepath (string), or Buffer of the mp4 file
1586
- * @param messageId message id of the message you want this sticker to reply to. [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1592
+ * @param messageId message id of the message you want this sticker to reply to. {@license:insiders@}
1587
1593
  */
1588
1594
  sendMp4AsSticker(to: ChatId, file: DataURL | Buffer | Base64 | string, processOptions?: Mp4StickerConversionProcessOptions, stickerMetadata?: StickerMetadata, messageId?: MessageId): Promise<MessageId | string | boolean>;
1589
1595
  /**
@@ -1591,7 +1597,7 @@ export declare class Client {
1591
1597
  *
1592
1598
  * @param to ChatId The chat id you want to send the webp sticker to
1593
1599
  * @param emojiId The discord emoji id without indentifying chars. In discord you would write `:who:`, here use `who`
1594
- * @param messageId message id of the message you want this sticker to reply to. [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1600
+ * @param messageId message id of the message you want this sticker to reply to. {@license:insiders@}
1595
1601
  */
1596
1602
  sendEmoji(to: ChatId, emojiId: string, messageId?: MessageId): Promise<MessageId | boolean | string>;
1597
1603
  /**
@@ -1602,7 +1608,7 @@ export declare class Client {
1602
1608
  */
1603
1609
  sendRawWebpAsSticker(to: ChatId, webpBase64: Base64, animated?: boolean): Promise<MessageId | string | boolean>;
1604
1610
  /**
1605
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1611
+ * {@license:insiders@}
1606
1612
  *
1607
1613
  * You can use this to send a raw webp file.
1608
1614
  * @param to ChatId The chat id you want to send the webp sticker to
@@ -1612,7 +1618,7 @@ export declare class Client {
1612
1618
  */
1613
1619
  sendRawWebpAsStickerAsReply(to: ChatId, messageId: MessageId, webpBase64: Base64, animated?: boolean): Promise<MessageId | string | boolean>;
1614
1620
  /**
1615
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1621
+ * {@license:insiders@}
1616
1622
  *
1617
1623
  * Turn the ephemeral setting in a chat to on or off
1618
1624
  * @param chatId The ID of the chat
@@ -87,6 +87,7 @@ class Client {
87
87
  constructor(page, createConfig, sessionInfo) {
88
88
  this._currentlyBeingKilled = false;
89
89
  this._refreshing = false;
90
+ this._loaded = false;
90
91
  this._prio = Number.MAX_SAFE_INTEGER;
91
92
  this._pageListeners = [];
92
93
  this._registeredPageListeners = [];
@@ -288,6 +289,7 @@ class Client {
288
289
  }), -1);
289
290
  this._onLogoutSet = true;
290
291
  }
292
+ this._loaded = true;
291
293
  });
292
294
  }
293
295
  registerAllSimpleListenersOnEv() {
@@ -505,6 +507,9 @@ class Client {
505
507
  });
506
508
  }
507
509
  responseWrap(res) {
510
+ if (this._loaded && typeof res === "string" && res.includes("requires") && res.includes("license")) {
511
+ console.info('\x1b[36m', "🔶", res, "🔶", '\x1b[0m');
512
+ }
508
513
  if (this._createConfig.onError && typeof res == "string" && (res.startsWith("Error") || res.startsWith("ERROR"))) {
509
514
  const e = this._createConfig.onError;
510
515
  /**
@@ -859,7 +864,7 @@ class Client {
859
864
  });
860
865
  }
861
866
  /**
862
- *[REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
867
+ *{@license:insiders@}
863
868
  *
864
869
  * Listens to new orders. Only works on business accounts
865
870
  */
@@ -869,7 +874,7 @@ class Client {
869
874
  });
870
875
  }
871
876
  /**
872
- *[REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
877
+ *{@license:insiders@}
873
878
  *
874
879
  * Listens to new orders. Only works on business accounts
875
880
  */
@@ -879,7 +884,7 @@ class Client {
879
884
  });
880
885
  }
881
886
  /**
882
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
887
+ * {@license:insiders@}
883
888
  *
884
889
  * Listens to reaction add and change events
885
890
  *
@@ -893,7 +898,7 @@ class Client {
893
898
  });
894
899
  }
895
900
  /**
896
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
901
+ * {@license:insiders@}
897
902
  *
898
903
  * Listens to chat state, including when a specific user is recording and typing within a group chat.
899
904
  *
@@ -953,7 +958,7 @@ class Client {
953
958
  });
954
959
  }
955
960
  /**
956
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
961
+ * {@license:insiders@}
957
962
  *
958
963
  * Fires callback with Chat object every time the host phone is removed to a group.
959
964
  *
@@ -967,7 +972,7 @@ class Client {
967
972
  });
968
973
  }
969
974
  /**
970
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
975
+ * {@license:insiders@}
971
976
  *
972
977
  * Fires callback with the relevant chat id every time the user clicks on a chat. This will only work in headful mode.
973
978
  *
@@ -981,7 +986,7 @@ class Client {
981
986
  });
982
987
  }
983
988
  /**
984
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
989
+ * {@license:insiders@}
985
990
  *
986
991
  * Fires callback with contact id when a new contact is added on the host phone.
987
992
  *
@@ -1065,7 +1070,7 @@ class Client {
1065
1070
  });
1066
1071
  }
1067
1072
  /**
1068
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1073
+ * {@license:insiders@}
1069
1074
  *
1070
1075
  * Adds label from chat, message or contact. Only for business accounts.
1071
1076
  * @param label: The desired text of the new label. id will be something simple like anhy nnumber from 1-10, name is the label of the label if that makes sense.
@@ -1285,8 +1290,13 @@ class Client {
1285
1290
  });
1286
1291
  }
1287
1292
  /**
1293
+ *
1294
+ * {@license:restricted@}
1295
+ *
1288
1296
  * Sends a text message to given chat
1289
- * If you need to send a message to new numbers please see [these instructions:](https://docs.openwa.dev/pages/The%20Client/licensed-features.html#sending-messages-to-non-contact-numbers)
1297
+ *
1298
+ * A license is **NOT** required to send messages with existing chats/contacts. A license is only required for starting conversations with new numbers.
1299
+ *
1290
1300
  * @param to chat id: `xxxxx@c.us`
1291
1301
  * @param content text message
1292
1302
  */
@@ -1355,6 +1365,8 @@ class Client {
1355
1365
  });
1356
1366
  }
1357
1367
  /**
1368
+ * {@license:insiders@}
1369
+ *
1358
1370
  * Send generic quick reply buttons. This is an insiders feature for MD accounts.
1359
1371
  *
1360
1372
  * @param {ChatId} to chat id
@@ -1429,8 +1441,6 @@ class Client {
1429
1441
  /**
1430
1442
  * {@license:insiders@}
1431
1443
  *
1432
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1433
- *
1434
1444
  * Send a list message. This will not work when being sent from business accounts!
1435
1445
  *
1436
1446
  * @param {ChatId} to
@@ -1468,7 +1478,7 @@ class Client {
1468
1478
  });
1469
1479
  }
1470
1480
  /**
1471
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1481
+ * {@license:insiders@}
1472
1482
  *
1473
1483
  * Tags everyone in the group with a message
1474
1484
  *
@@ -1633,7 +1643,7 @@ class Client {
1633
1643
  catch (error) {
1634
1644
  logging_1.log.error(error);
1635
1645
  }
1636
- if (linkData)
1646
+ if (linkData && (thumbnail || thumb))
1637
1647
  return yield this.sendMessageWithThumb(thumbnail || thumb, url, linkData.title, linkData.description, text, to);
1638
1648
  else
1639
1649
  return yield this.pup(({ to, url, text, thumbnail }) => WAPI.sendLinkWithAutoPreview(to, url, text, thumbnail), { to, url, text, thumbnail });
@@ -1657,7 +1667,7 @@ class Client {
1657
1667
  });
1658
1668
  }
1659
1669
  /**
1660
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1670
+ * {@license:insiders@}
1661
1671
  *
1662
1672
  * Check if a recipient has read receipts on.
1663
1673
  *
@@ -1697,7 +1707,7 @@ class Client {
1697
1707
  });
1698
1708
  }
1699
1709
  /**
1700
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1710
+ * {@license:insiders@}
1701
1711
  *
1702
1712
  * Checks whether or not the group id provided is known to be unsafe by the contributors of the library.
1703
1713
  * @param groupChatId The group chat you want to deteremine is unsafe
@@ -1934,7 +1944,7 @@ class Client {
1934
1944
  }
1935
1945
  /**
1936
1946
  *
1937
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
1947
+ * {@license:insiders@}
1938
1948
  *
1939
1949
  * Sends multiple contacts as a single message
1940
1950
  *
@@ -1990,7 +2000,7 @@ class Client {
1990
2000
  }
1991
2001
  /**
1992
2002
  *
1993
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
2003
+ * {@license:insiders@}
1994
2004
  *
1995
2005
  * Mutes a conversation for a given duration. If already muted, this will update the muted duration. Mute durations are relative from when the method is called.
1996
2006
  * @param chatId The id of the conversation you want to mute
@@ -2014,7 +2024,7 @@ class Client {
2014
2024
  }
2015
2025
  /**
2016
2026
  *
2017
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
2027
+ * {@license:insiders@}
2018
2028
  *
2019
2029
  * Unmutes a conversation.
2020
2030
  * @param id The id of the conversation you want to mute
@@ -2249,9 +2259,9 @@ class Client {
2249
2259
  });
2250
2260
  }
2251
2261
  /**
2252
- * Report a contact for spam, block them and attempt to clear chat.
2262
+ * {@license:restricted@}
2253
2263
  *
2254
- * [This is a restricted feature and requires a restricted key.](https://gum.co/open-wa?tier=1%20Restricted%20License%20Key)
2264
+ * Report a contact for spam, block them and attempt to clear chat.
2255
2265
  *
2256
2266
  * @param {string} id '000000000000@c.us'
2257
2267
  */
@@ -2349,7 +2359,7 @@ class Client {
2349
2359
  });
2350
2360
  }
2351
2361
  /**
2352
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
2362
+ * {@license:insiders@}
2353
2363
  *
2354
2364
  * Get the detailed message info for a group message sent out by the host account.
2355
2365
  * @param messageId The message Id
@@ -2360,7 +2370,7 @@ class Client {
2360
2370
  });
2361
2371
  }
2362
2372
  /**
2363
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
2373
+ * {@license:insiders@}
2364
2374
  *
2365
2375
  * Retrieves an order object
2366
2376
  * @param messageId or OrderId
@@ -2372,7 +2382,7 @@ class Client {
2372
2382
  });
2373
2383
  }
2374
2384
  /**
2375
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
2385
+ * {@license:insiders@}
2376
2386
  *
2377
2387
  * Add a product to your catalog
2378
2388
  *
@@ -2395,7 +2405,7 @@ class Client {
2395
2405
  });
2396
2406
  }
2397
2407
  /**
2398
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
2408
+ * {@license:insiders@}
2399
2409
  *
2400
2410
  * Edit a product in your catalog
2401
2411
  *
@@ -2416,7 +2426,7 @@ class Client {
2416
2426
  });
2417
2427
  }
2418
2428
  /**
2419
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
2429
+ * {@license:insiders@}
2420
2430
  *
2421
2431
  * Send a product to a chat
2422
2432
  *
@@ -2444,7 +2454,7 @@ class Client {
2444
2454
  /**
2445
2455
  * Retrieves the last message sent by the host account in any given chat or globally.
2446
2456
  * @param chatId This is optional. If no chat Id is set then the last message sent by the host account will be returned.
2447
- * @returns message object
2457
+ * @returns message object or `undefined` if the host account's last message could not be found.
2448
2458
  */
2449
2459
  getMyLastMessage(chatId) {
2450
2460
  return __awaiter(this, void 0, void 0, function* () {
@@ -2512,7 +2522,7 @@ class Client {
2512
2522
  }
2513
2523
  /**
2514
2524
  *
2515
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
2525
+ * {@license:insiders@}
2516
2526
  *
2517
2527
  * If a file is old enough, it will 404 if you try to decrypt it. This will allow you to force the host account to re upload the file and return a decryptable message.
2518
2528
  *
@@ -2540,7 +2550,7 @@ class Client {
2540
2550
  });
2541
2551
  }
2542
2552
  /**
2543
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
2553
+ * {@license:insiders@}
2544
2554
  *
2545
2555
  * Retrieves the groups that you have in common with a contact
2546
2556
  * @param contactId
@@ -2638,9 +2648,9 @@ class Client {
2638
2648
  }
2639
2649
  /**
2640
2650
  *
2641
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
2651
+ * {@license:insiders@}
2642
2652
  *
2643
- * Use a Baileys payload within your open-wa session
2653
+ * Use a raw payload within your open-wa session
2644
2654
  *
2645
2655
  * @param chatId
2646
2656
  * @param payload {any}
@@ -2992,7 +3002,7 @@ class Client {
2992
3002
  });
2993
3003
  }
2994
3004
  /**
2995
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
3005
+ * {@license:insiders@}
2996
3006
  *
2997
3007
  * Change the group chat title
2998
3008
  * @param groupId '0000000000-00000000@g.us' the group id.
@@ -3014,7 +3024,7 @@ class Client {
3014
3024
  });
3015
3025
  }
3016
3026
  /**
3017
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
3027
+ * {@license:insiders@}
3018
3028
  *
3019
3029
  * Set the wallpaper background colour
3020
3030
  * @param {string} hex '#FFF123'
@@ -3072,7 +3082,7 @@ class Client {
3072
3082
  });
3073
3083
  }
3074
3084
  /**
3075
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
3085
+ * {@license:insiders@}
3076
3086
  *
3077
3087
  * Sends a sticker from a given URL
3078
3088
  * @param to The recipient id.
@@ -3093,7 +3103,7 @@ class Client {
3093
3103
  });
3094
3104
  }
3095
3105
  /**
3096
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
3106
+ * {@license:insiders@}
3097
3107
  *
3098
3108
  * This function takes an image and sends it as a sticker to the recipient as a reply to another message.
3099
3109
  *
@@ -3258,7 +3268,7 @@ class Client {
3258
3268
  *
3259
3269
  * @param to ChatId The chat id you want to send the webp sticker to
3260
3270
  * @param file [[DataURL]], [[Base64]], URL (string GET), Relative filepath (string), or Buffer of the mp4 file
3261
- * @param messageId message id of the message you want this sticker to reply to. [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
3271
+ * @param messageId message id of the message you want this sticker to reply to. {@license:insiders@}
3262
3272
  */
3263
3273
  sendMp4AsSticker(to, file, processOptions = media_1.defaultProcessOptions, stickerMetadata, messageId) {
3264
3274
  return __awaiter(this, void 0, void 0, function* () {
@@ -3308,7 +3318,7 @@ class Client {
3308
3318
  *
3309
3319
  * @param to ChatId The chat id you want to send the webp sticker to
3310
3320
  * @param emojiId The discord emoji id without indentifying chars. In discord you would write `:who:`, here use `who`
3311
- * @param messageId message id of the message you want this sticker to reply to. [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
3321
+ * @param messageId message id of the message you want this sticker to reply to. {@license:insiders@}
3312
3322
  */
3313
3323
  sendEmoji(to, emojiId, messageId) {
3314
3324
  return __awaiter(this, void 0, void 0, function* () {
@@ -3342,7 +3352,7 @@ class Client {
3342
3352
  });
3343
3353
  }
3344
3354
  /**
3345
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
3355
+ * {@license:insiders@}
3346
3356
  *
3347
3357
  * You can use this to send a raw webp file.
3348
3358
  * @param to ChatId The chat id you want to send the webp sticker to
@@ -3363,7 +3373,7 @@ class Client {
3363
3373
  });
3364
3374
  }
3365
3375
  /**
3366
- * [REQUIRES AN INSIDERS LICENSE-KEY](https://gum.co/open-wa?tier=Insiders%20Program)
3376
+ * {@license:insiders@}
3367
3377
  *
3368
3378
  * Turn the ephemeral setting in a chat to on or off
3369
3379
  * @param chatId The ID of the chat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.43.2",
3
+ "version": "4.43.5",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",
@@ -143,7 +143,7 @@
143
143
  "parse-function": "^5.6.10",
144
144
  "parse-url": "^5.0.2",
145
145
  "patch-package": "^6.2.2",
146
- "pico-s3": "^1.0.1",
146
+ "pico-s3": "^2.0.0",
147
147
  "pidtree": "^0.6.0",
148
148
  "pidusage": "^3.0.0",
149
149
  "postman-2-swagger": "^0.5.0",
package/.eslintrc.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "env": {
3
- "es2021": true,
4
- "node": true
5
- },
6
- "extends": [
7
- "eslint:recommended",
8
- "plugin:@typescript-eslint/recommended"
9
- ],
10
- "parser": "@typescript-eslint/parser",
11
- "parserOptions": {
12
- "ecmaVersion": 12,
13
- "sourceType": "module"
14
- },
15
- "plugins": [
16
- "@typescript-eslint"
17
- ],
18
- "rules": {
19
- "@typescript-eslint/no-explicit-any" : "off",
20
- "@typescript-eslint/no-empty-function" : "off",
21
- "no-async-promise-executor" : "off",
22
- "@typescript-eslint/ban-ts-comment" : "off"
23
- }
24
- }