@vanzxy/baileys 1.2.0 → 1.2.2
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/lib/Utils/messages.js +26 -42
- package/package.json +1 -1
package/lib/Utils/messages.js
CHANGED
|
@@ -492,49 +492,43 @@ const prepareNativeFlowButtons = (message) => {
|
|
|
492
492
|
if (hasOptionalProperty(button, 'id') && !!button.id) {
|
|
493
493
|
return {
|
|
494
494
|
name: 'quick_reply',
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
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
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
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
|
-
|
|
525
|
-
|
|
526
|
-
|
|
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
|
|
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
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
})
|
|
529
|
+
title: buttonText || '📋 Select',
|
|
530
|
+
sections: button.sections,
|
|
531
|
+
icon: buttonIcon
|
|
538
532
|
};
|
|
539
533
|
}
|
|
540
534
|
return button;
|
|
@@ -1413,23 +1407,13 @@ export const generateWAMessageContent = async (message, options) => {
|
|
|
1413
1407
|
}
|
|
1414
1408
|
return WAProto.Message.create(m);
|
|
1415
1409
|
};
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
body: {
|
|
1424
|
-
text: captionText
|
|
1425
|
-
},
|
|
1426
|
-
nativeFlowMessage: {
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
};
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
const generateWAMessageFromContent = (jid, message, options) => {
|
|
1410
|
+
const processImageMessage = (message, captionText) => {
|
|
1411
|
+
if (message.imageMessage) {
|
|
1412
|
+
message.imageMessage.caption = captionText;
|
|
1413
|
+
}
|
|
1414
|
+
return message;
|
|
1415
|
+
};
|
|
1416
|
+
export const generateWAMessageFromContent = (jid, message, options) => {
|
|
1433
1417
|
// set timestamp to now
|
|
1434
1418
|
// if not specified
|
|
1435
1419
|
if (!options.timestamp) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vanzxy/baileys",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
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",
|