@vanzxy/baileys 1.1.5 → 1.2.1

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.
@@ -1,4 +1,4 @@
1
- import { Boom } from '@hapi/boom';import { Boom } from '@hapiimport { Boom } from '@hapi/boom';
1
+ import { Boom } from '@hapi/boom';
2
2
  import { randomBytes } from 'crypto';
3
3
  import { zip } from 'fflate';
4
4
  import { promises as fs } from 'fs';
@@ -492,49 +492,43 @@ const prepareNativeFlowButtons = (message) => {
492
492
  if (hasOptionalProperty(button, 'id') && !!button.id) {
493
493
  return {
494
494
  name: 'quick_reply',
495
- display_text: buttonText || '👉🏻 Click',
496
- id: button.id,
497
- icon: buttonIcon
498
- })
495
+ display_text: buttonText || '👉🏻 Click',
496
+ id: button.id,
497
+ icon: buttonIcon
499
498
  };
500
- }
501
- else if (hasOptionalProperty(button, 'copy') && !!button.copy) {
499
+ } else if (hasOptionalProperty(button, 'copy') && !!button.copy) {
502
500
  return {
503
501
  name: 'cta_copy',
504
- display_text: buttonText || '📋 Copy',
505
- copy_code: button.copy,
506
- icon: buttonIcon
507
- })
502
+ display_text: buttonText || '📋 Copy',
503
+ copy_code: button.copy,
504
+ icon: buttonIcon
508
505
  };
509
506
  }
510
507
  else if (hasOptionalProperty(button, 'url') && !!button.url) {
511
508
  return {
512
509
  name: 'cta_url',
513
- display_text: buttonText || '🌐 Visit',
514
- url: button.url,
515
- merchant_url: button.url,
516
- webview_interaction: button.useWebview,
517
- icon: buttonIcon
518
- })
510
+ display_text: buttonText || '🌐 Visit',
511
+ url: button.url,
512
+ merchant_url: button.url,
513
+ webview_interaction: button.useWebview,
514
+ icon: buttonIcon
519
515
  };
520
516
  }
521
517
  else if (hasOptionalProperty(button, 'call') && !!button.call) {
522
518
  return {
523
519
  name: 'cta_call',
524
- display_text: buttonText || '📞 Call',
525
- phone_number: button.call,
526
- icon: buttonIcon
527
- })
520
+ display_text: buttonText || '📞 Call',
521
+ phone_number: button.call,
522
+ icon: buttonIcon
528
523
  };
529
524
  }
530
- // Lia@Changes 12-03-26 --- Add "single_select" shortcut \⁠(⁠°⁠o⁠°⁠)⁠/
525
+ // Lia@Changes 12-03-26 --- Add "single_select" shortcut \\(\°\o\°\)\/
531
526
  else if (hasOptionalProperty(button, 'sections') && !!button.sections) {
532
527
  return {
533
528
  name: 'single_select',
534
- title: buttonText || '📋 Select',
535
- sections: button.sections,
536
- icon: buttonIcon
537
- })
529
+ title: buttonText || '📋 Select',
530
+ sections: button.sections,
531
+ icon: buttonIcon
538
532
  };
539
533
  }
540
534
  return button;
@@ -1413,22 +1407,12 @@ export const generateWAMessageContent = async (message, options) => {
1413
1407
  }
1414
1408
  return WAProto.Message.create(m);
1415
1409
  };
1416
- export
1417
- delete message.imageMessage.caption; // Hapus caption bawaan agar tidak double
1418
-
1419
- message = {
1420
- header: {
1421
- imageMessage: message.imageMessage
1422
- },
1423
- body: {
1424
- text: captionText
1425
- },
1426
- nativeFlowMessage: {
1427
- }
1428
- }
1429
- };
1430
- }
1431
-
1410
+ const processImageMessage = (message, captionText) => {
1411
+ if (message.imageMessage) {
1412
+ message.imageMessage.caption = captionText;
1413
+ }
1414
+ return message;
1415
+ };
1432
1416
  const generateWAMessageFromContent = (jid, message, options) => {
1433
1417
  // set timestamp to now
1434
1418
  // if not specified
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vanzxy/baileys",
3
- "version": "1.1.5",
3
+ "version": "1.2.1",
4
4
  "description": "Enhanced Baileys fork by Vanzxy — based on @itsliaaa/baileys + @whiskeysockets/baileys with fixes for audio group status and clean media without newsletter button.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",