@ryuu-reinzz/haruka-lib 3.5.1 → 3.6.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 (2) hide show
  1. package/main/socket.js +18 -8
  2. package/package.json +1 -1
package/main/socket.js CHANGED
@@ -262,6 +262,8 @@ export default function addProperty(socket, baileys) {
262
262
  contextInfo = {},
263
263
  bottom_sheet = false,
264
264
  bottom_name = "",
265
+ limited_time_offer_text = "",
266
+ limited_time_offer = false,
265
267
  mentionedJid = []
266
268
  } = content;
267
269
 
@@ -453,17 +455,25 @@ export default function addProperty(socket, baileys) {
453
455
  messageContent.nativeFlowMessage = {
454
456
  buttons: processedButtons,
455
457
  };
458
+ const params = {};
456
459
 
457
460
  if (bottom_sheet) {
458
- messageContent.nativeFlowMessage.messageParamsJson = JSON.stringify({
459
- bottom_sheet: {
460
- in_thread_buttons_limit: 1,
461
- divider_indices: [1, 2],
462
- list_title: bottom_name,
463
- button_title: bottom_name
464
- }
465
- });
461
+ params.bottom_sheet = {
462
+ in_thread_buttons_limit: 1,
463
+ divider_indices: [1, 2],
464
+ list_title: bottom_name,
465
+ button_title: bottom_name
466
+ };
467
+ }
468
+ if (limited_time_offer) {
469
+ params.limited_time_offer = {
470
+ text: limited_time_offer_text || "",
471
+ url: '',
472
+ copy_code: '',
473
+ expiration_time: Date.now() + (1000 * 60 * 60 * 24 * 7)
474
+ };
466
475
  }
476
+ messageContent.nativeFlowMessage.messageParamsJson = JSON.stringify(params);
467
477
 
468
478
  if (contextInfo.externalAdReply && typeof contextInfo.externalAdReply === "object") {
469
479
  messageContent.contextInfo = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuu-reinzz/haruka-lib",
3
- "version": "3.5.1",
3
+ "version": "3.6.0",
4
4
  "description": "Library extra for bot WhatsApp",
5
5
  "main": "main/index.js",
6
6
  "type": "module",