@itsliaaa/baileys 0.1.3 â 0.1.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.
- package/README.md +65 -69
- package/WAProto/index.js +1188 -244
- package/lib/Defaults/index.js +2 -2
- package/lib/Socket/messages-send.js +106 -13
- package/lib/Socket/socket.js +1 -2
- package/lib/Utils/generics.js +1 -1
- package/lib/Utils/messages.js +62 -40
- package/lib/WABinary/generic-utils.js +49 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,21 +8,21 @@ A lightweight fork of Baileys with a few fixes and a small adjustment.
|
|
|
8
8
|
|
|
9
9
|
#### đ ď¸ Internal Adjustments
|
|
10
10
|
- đźď¸ Fixed an issue where media could not be sent to newsletters due to an upstream issue.
|
|
11
|
-
- đ Reintroduced `makeInMemoryStore` with a minimal ESM adaptation and small adjustments for Baileys v7.
|
|
11
|
+
- đ Reintroduced [`makeInMemoryStore`](#%EF%B8%8F-implementing-a-data-store) with a minimal ESM adaptation and small adjustments for Baileys v7.
|
|
12
12
|
- đŚ Switched FFmpeg execution from `exec` to `spawn` for safer process handling.
|
|
13
13
|
- đď¸ Added `@napi-rs/image` as a supported image processing backend in `getImageProcessingLibrary()`, offering a balance between performance and compatibility.
|
|
14
14
|
|
|
15
15
|
#### đ¨ Message Handling & Compatibility
|
|
16
|
-
- đđť Added support for sending interactive message types (button, list, interactive, template, carousel).
|
|
17
|
-
- đŠ Added support for album messages, group status messages, sticker pack messages, and several payment-related messages (request payment, payment invite, order, invoice).
|
|
18
|
-
- đ° Simplified sending messages with ad thumbnails via `externalAdReply` without requiring manual `contextInfo`.
|
|
16
|
+
- đđť Added support for sending [interactive message](#-sending-interactive-messages) types (button, list, interactive, template, carousel).
|
|
17
|
+
- đŠ Added support for [album messages](#%EF%B8%8F-album-image--video), [group status messages](#4%EF%B8%8FâŁ-group-status), [status mention messages](#%EF%B8%8F-status-mention), [sticker pack messages](#-sticker-pack), and several [payment-related messages](#-sending-payment-messages) (request payment, payment invite, order, invoice).
|
|
18
|
+
- đ° Simplified sending messages with ad thumbnails via [`externalAdReply`](#3%EF%B8%8FâŁ-external-ad-reply) without requiring manual `contextInfo`.
|
|
19
19
|
|
|
20
20
|
#### đ§Š Additional Message Options
|
|
21
21
|
- đď¸ Added optional boolean flags for message handling:
|
|
22
|
-
- `ai` - AI label on message
|
|
23
|
-
- `mentionAll` - Mentions all group participants without requiring their JIDs in `mentions` or `mentionedJid`
|
|
24
|
-
- `ephemeral
|
|
25
|
-
- `raw` - Build your message manually **(DO NOT USE FOR EXPLOITATION)**
|
|
22
|
+
- [`ai`](#1%EF%B8%8FâŁ-ai-label) - AI label on message
|
|
23
|
+
- [`mentionAll`](#-mention) - Mentions all group participants without requiring their JIDs in `mentions` or `mentionedJid`
|
|
24
|
+
- [`ephemeral`](#2%EF%B8%8FâŁ-ephemeral), [`groupStatus`](#4%EF%B8%8FâŁ-group-status), [`viewOnceV2`](#7%EF%B8%8FâŁ-view-once-v2), [`viewOnceV2Extension`](#8%EF%B8%8FâŁ-view-once-v2-extension), [`interactiveAsTemplate`](#3%EF%B8%8FâŁ-interactive) - Message wrappers
|
|
25
|
+
- [`raw`](#5%EF%B8%8FâŁ-raw) - Build your message manually **(DO NOT USE FOR EXPLOITATION)**
|
|
26
26
|
|
|
27
27
|
> [!NOTE]
|
|
28
28
|
đ This project is maintained with limited scope and is not intended to replace upstream Baileys.
|
|
@@ -224,17 +224,15 @@ sock.sendMessage(jid, {
|
|
|
224
224
|
##### đ Mention
|
|
225
225
|
|
|
226
226
|
```javascript
|
|
227
|
+
// --- Regular mention
|
|
227
228
|
sock.sendMessage(jid, {
|
|
228
229
|
text: 'đđť Hello @628123456789',
|
|
229
230
|
mentions: ['628123456789@s.whatsapp.net']
|
|
230
231
|
}, {
|
|
231
232
|
quoted: message
|
|
232
233
|
})
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
##### đ§âđ§âđ§âđ§ Mention All
|
|
236
234
|
|
|
237
|
-
|
|
235
|
+
// --- Mention all
|
|
238
236
|
sock.sendMessage(jid, {
|
|
239
237
|
text: 'đđť Hello @all',
|
|
240
238
|
mentionAll: true
|
|
@@ -331,7 +329,7 @@ sock.sendMessage('1211111111111@newsletter', {
|
|
|
331
329
|
quoted: message
|
|
332
330
|
})
|
|
333
331
|
|
|
334
|
-
// Poll result
|
|
332
|
+
// --- Poll result
|
|
335
333
|
sock.sendMessage(jid, {
|
|
336
334
|
pollResult: {
|
|
337
335
|
name: 'đ Poll Result',
|
|
@@ -348,7 +346,7 @@ sock.sendMessage(jid, {
|
|
|
348
346
|
quoted: message
|
|
349
347
|
})
|
|
350
348
|
|
|
351
|
-
// Poll update
|
|
349
|
+
// --- Poll update
|
|
352
350
|
sock.sendMessage(jid, {
|
|
353
351
|
pollUpdate: {
|
|
354
352
|
metadata: {},
|
|
@@ -363,6 +361,14 @@ sock.sendMessage(jid, {
|
|
|
363
361
|
})
|
|
364
362
|
```
|
|
365
363
|
|
|
364
|
+
##### đď¸ Status Mention
|
|
365
|
+
|
|
366
|
+
```javascript
|
|
367
|
+
sock.sendMessage([jidA, jidB, jidC], {
|
|
368
|
+
text: 'Hello! đđť'
|
|
369
|
+
})
|
|
370
|
+
```
|
|
371
|
+
|
|
366
372
|
#### đ Sending Media Messages
|
|
367
373
|
|
|
368
374
|
> [!NOTE]
|
|
@@ -454,7 +460,7 @@ sock.sendMessage(jid, {
|
|
|
454
460
|
##### đŚ Sticker Pack
|
|
455
461
|
|
|
456
462
|
> [!IMPORTANT]
|
|
457
|
-
If
|
|
463
|
+
If `sharp` or `@napi-rs/image` is not installed, the `cover` and `stickers` must already be in WebP format.
|
|
458
464
|
|
|
459
465
|
```javascript
|
|
460
466
|
sock.sendMessage(jid, {
|
|
@@ -484,9 +490,10 @@ sock.sendMessage(jid, {
|
|
|
484
490
|
|
|
485
491
|
#### đđť Sending Interactive Messages
|
|
486
492
|
|
|
487
|
-
##### 1ď¸âŁ Buttons
|
|
493
|
+
##### 1ď¸âŁ Buttons
|
|
488
494
|
|
|
489
495
|
```javascript
|
|
496
|
+
// --- Regular buttons message
|
|
490
497
|
sock.sendMessage(jid, {
|
|
491
498
|
text: 'đđť Buttons!',
|
|
492
499
|
footer: '@itsliaaa/baileys',
|
|
@@ -497,11 +504,8 @@ sock.sendMessage(jid, {
|
|
|
497
504
|
}, {
|
|
498
505
|
quoted: message
|
|
499
506
|
})
|
|
500
|
-
```
|
|
501
|
-
|
|
502
|
-
##### đźď¸ Buttons (With Media & Native Flow)
|
|
503
507
|
|
|
504
|
-
|
|
508
|
+
// --- Buttons with Media & Native Flow
|
|
505
509
|
sock.sendMessage(jid, {
|
|
506
510
|
image: {
|
|
507
511
|
url: './path/to/image.jpg'
|
|
@@ -512,35 +516,32 @@ sock.sendMessage(jid, {
|
|
|
512
516
|
text: 'đđť Rating',
|
|
513
517
|
id: '#Rating'
|
|
514
518
|
}, {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
title: '
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
description: '',
|
|
533
|
-
id: '#CouponCode'
|
|
534
|
-
}]
|
|
519
|
+
text: 'đ Select',
|
|
520
|
+
sections: [{
|
|
521
|
+
title: '⨠Section 1',
|
|
522
|
+
rows: [{
|
|
523
|
+
header: '',
|
|
524
|
+
title: 'đ Secret Ingredient',
|
|
525
|
+
description: '',
|
|
526
|
+
id: '#SecretIngredient'
|
|
527
|
+
}]
|
|
528
|
+
}, {
|
|
529
|
+
title: '⨠Section 2',
|
|
530
|
+
highlight_label: 'đĽ Popular',
|
|
531
|
+
rows: [{
|
|
532
|
+
header: '',
|
|
533
|
+
title: 'đˇď¸ Coupon',
|
|
534
|
+
description: '',
|
|
535
|
+
id: '#CouponCode'
|
|
535
536
|
}]
|
|
536
|
-
}
|
|
537
|
+
}]
|
|
537
538
|
}]
|
|
538
539
|
}, {
|
|
539
540
|
quoted: message
|
|
540
541
|
})
|
|
541
542
|
```
|
|
542
543
|
|
|
543
|
-
##### 2ď¸âŁ List
|
|
544
|
+
##### 2ď¸âŁ List
|
|
544
545
|
|
|
545
546
|
> [!NOTE]
|
|
546
547
|
It only works in private chat (`@s.whatsapp.net`).
|
|
@@ -571,9 +572,10 @@ sock.sendMessage(jid, {
|
|
|
571
572
|
})
|
|
572
573
|
```
|
|
573
574
|
|
|
574
|
-
##### 3ď¸âŁ Interactive
|
|
575
|
+
##### 3ď¸âŁ Interactive
|
|
575
576
|
|
|
576
577
|
```javascript
|
|
578
|
+
// --- Native Flow
|
|
577
579
|
sock.sendMessage(jid, {
|
|
578
580
|
image: {
|
|
579
581
|
url: './path/to/image.jpg'
|
|
@@ -597,38 +599,32 @@ sock.sendMessage(jid, {
|
|
|
597
599
|
text: 'đ Source',
|
|
598
600
|
url: 'https://www.npmjs.com/package/baileys'
|
|
599
601
|
}, {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
title: '
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
description: '',
|
|
618
|
-
id: '#SecretIngredient'
|
|
619
|
-
}]
|
|
602
|
+
text: 'đ Select',
|
|
603
|
+
sections: [{
|
|
604
|
+
title: '⨠Section 1',
|
|
605
|
+
rows: [{
|
|
606
|
+
header: '',
|
|
607
|
+
title: 'đˇď¸ Coupon',
|
|
608
|
+
description: '',
|
|
609
|
+
id: '#CouponCode'
|
|
610
|
+
}]
|
|
611
|
+
}, {
|
|
612
|
+
title: '⨠Section 2',
|
|
613
|
+
highlight_label: 'đĽ Popular',
|
|
614
|
+
rows: [{
|
|
615
|
+
header: '',
|
|
616
|
+
title: 'đ Secret Ingredient',
|
|
617
|
+
description: '',
|
|
618
|
+
id: '#SecretIngredient'
|
|
620
619
|
}]
|
|
621
|
-
}
|
|
620
|
+
}]
|
|
622
621
|
}],
|
|
623
622
|
interactiveAsTemplate: false, // --- Optional, wrap the interactive message into a template
|
|
624
623
|
}, {
|
|
625
624
|
quoted: message
|
|
626
625
|
})
|
|
627
|
-
```
|
|
628
626
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
```javascript
|
|
627
|
+
// --- Carousel & Native Flow
|
|
632
628
|
sock.sendMessage(jid, {
|
|
633
629
|
text: 'đď¸ Interactive with Carousel!',
|
|
634
630
|
footer: '@itsliaaa/baileys',
|
|
@@ -677,7 +673,7 @@ sock.sendMessage(jid, {
|
|
|
677
673
|
})
|
|
678
674
|
```
|
|
679
675
|
|
|
680
|
-
##### 4ď¸âŁ
|
|
676
|
+
##### 4ď¸âŁ Hydrated Template
|
|
681
677
|
|
|
682
678
|
```javascript
|
|
683
679
|
sock.sendMessage(jid, {
|