@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 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`, `groupStatus`, `viewOnceV2`, `viewOnceV2Extension`, `interactiveAsTemplate` - Message wrappers
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
- ```javascript
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 Sharp is not installed, the `cover` and `stickers` must already be in WebP format.
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 (Classic)
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
- ```javascript
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
- name: 'single_select',
516
- paramsJson: JSON.stringify({
517
- title: '📋 Select',
518
- sections: [{
519
- title: '✨ Section 1',
520
- rows: [{
521
- header: '',
522
- title: '💭 Secret Ingredient',
523
- description: '',
524
- id: '#SecretIngredient'
525
- }]
526
- }, {
527
- title: '✨ Section 2',
528
- highlight_label: '🔥 Popular',
529
- rows: [{
530
- header: '',
531
- title: '🏷️ Coupon',
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 (Classic)
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 (Native Flow)
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
- name: 'single_select',
601
- buttonParamsJson: JSON.stringify({
602
- title: '📋 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'
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
- ##### 🎠 Interactive (Carousel & Native Flow)
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️⃣ Template (Hydrated Template)
676
+ ##### 4️⃣ Hydrated Template
681
677
 
682
678
  ```javascript
683
679
  sock.sendMessage(jid, {