@itsliaaa/baileys 0.1.2 → 0.1.4

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), [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: {},
@@ -454,7 +452,7 @@ sock.sendMessage(jid, {
454
452
  ##### 📦 Sticker Pack
455
453
 
456
454
  > [!IMPORTANT]
457
- If Sharp is not installed, the `cover` and `stickers` must already be in WebP format.
455
+ If `sharp` or `@napi-rs/image` is not installed, the `cover` and `stickers` must already be in WebP format.
458
456
 
459
457
  ```javascript
460
458
  sock.sendMessage(jid, {
@@ -484,9 +482,10 @@ sock.sendMessage(jid, {
484
482
 
485
483
  #### 👉🏻 Sending Interactive Messages
486
484
 
487
- ##### 1️⃣ Buttons (Classic)
485
+ ##### 1️⃣ Buttons
488
486
 
489
487
  ```javascript
488
+ // --- Regular buttons message
490
489
  sock.sendMessage(jid, {
491
490
  text: '👆🏻 Buttons!',
492
491
  footer: '@itsliaaa/baileys',
@@ -497,11 +496,8 @@ sock.sendMessage(jid, {
497
496
  }, {
498
497
  quoted: message
499
498
  })
500
- ```
501
499
 
502
- ##### 🖼️ Buttons (With Media & Native Flow)
503
-
504
- ```javascript
500
+ // --- Buttons with Media & Native Flow
505
501
  sock.sendMessage(jid, {
506
502
  image: {
507
503
  url: './path/to/image.jpg'
@@ -512,35 +508,32 @@ sock.sendMessage(jid, {
512
508
  text: '👋🏻 Rating',
513
509
  id: '#Rating'
514
510
  }, {
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
- }]
511
+ text: '📋 Select',
512
+ sections: [{
513
+ title: '✨ Section 1',
514
+ rows: [{
515
+ header: '',
516
+ title: '💭 Secret Ingredient',
517
+ description: '',
518
+ id: '#SecretIngredient'
519
+ }]
520
+ }, {
521
+ title: '✨ Section 2',
522
+ highlight_label: '🔥 Popular',
523
+ rows: [{
524
+ header: '',
525
+ title: '🏷️ Coupon',
526
+ description: '',
527
+ id: '#CouponCode'
535
528
  }]
536
- })
529
+ }]
537
530
  }]
538
531
  }, {
539
532
  quoted: message
540
533
  })
541
534
  ```
542
535
 
543
- ##### 2️⃣ List (Classic)
536
+ ##### 2️⃣ List
544
537
 
545
538
  > [!NOTE]
546
539
  It only works in private chat (`@s.whatsapp.net`).
@@ -571,9 +564,10 @@ sock.sendMessage(jid, {
571
564
  })
572
565
  ```
573
566
 
574
- ##### 3️⃣ Interactive (Native Flow)
567
+ ##### 3️⃣ Interactive
575
568
 
576
569
  ```javascript
570
+ // --- Native Flow
577
571
  sock.sendMessage(jid, {
578
572
  image: {
579
573
  url: './path/to/image.jpg'
@@ -597,38 +591,32 @@ sock.sendMessage(jid, {
597
591
  text: '🌐 Source',
598
592
  url: 'https://www.npmjs.com/package/baileys'
599
593
  }, {
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
- }]
594
+ text: '📋 Select',
595
+ sections: [{
596
+ title: '✨ Section 1',
597
+ rows: [{
598
+ header: '',
599
+ title: '🏷️ Coupon',
600
+ description: '',
601
+ id: '#CouponCode'
602
+ }]
603
+ }, {
604
+ title: '✨ Section 2',
605
+ highlight_label: '🔥 Popular',
606
+ rows: [{
607
+ header: '',
608
+ title: '💭 Secret Ingredient',
609
+ description: '',
610
+ id: '#SecretIngredient'
620
611
  }]
621
- })
612
+ }]
622
613
  }],
623
614
  interactiveAsTemplate: false, // --- Optional, wrap the interactive message into a template
624
615
  }, {
625
616
  quoted: message
626
617
  })
627
- ```
628
-
629
- ##### 🎠 Interactive (Carousel & Native Flow)
630
618
 
631
- ```javascript
619
+ // --- Carousel & Native Flow
632
620
  sock.sendMessage(jid, {
633
621
  text: '🗂️ Interactive with Carousel!',
634
622
  footer: '@itsliaaa/baileys',
@@ -677,7 +665,7 @@ sock.sendMessage(jid, {
677
665
  })
678
666
  ```
679
667
 
680
- ##### 4️⃣ Template (Hydrated Template)
668
+ ##### 4️⃣ Hydrated Template
681
669
 
682
670
  ```javascript
683
671
  sock.sendMessage(jid, {