@itsliaaa/baileys 0.1.29 โ†’ 0.1.31

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
@@ -53,14 +53,19 @@ Hi everyone,
53
53
  >
54
54
  > Thank you for taking the time to read this ๐Ÿค
55
55
 
56
+ > [!NOTE]
57
+ ๐Ÿ“„ This project is maintained with limited scope and is not intended to replace upstream Baileys.
58
+ >
59
+ > ๐Ÿ˜ž And, really sorry for my bad english.
60
+
56
61
  ### ๐Ÿ› ๏ธ Internal Adjustments
57
62
  - ๐Ÿ–ผ๏ธ Fixed an issue where media could not be sent to newsletters due to an upstream issue.
58
63
  - ๐Ÿ“ Reintroduced [`makeInMemoryStore`](#%EF%B8%8F-implementing-a-data-store) with a minimal ESM adaptation and small adjustments for Baileys v7.
59
64
  - ๐Ÿ“ฆ Switched FFmpeg execution from `exec` to `spawn` for safer process handling.
60
65
  - ๐Ÿ—ƒ๏ธ Added [`@napi-rs/image`](https://www.npmjs.com/package/@napi-rs/image) as a supported image processing backend in [`getImageProcessingLibrary()`](#%EF%B8%8F-image-processing), offering a balance between performance and compatibility.
61
66
 
62
- ### ๐Ÿ“จ Message Handling & Compatibility
63
- - ๐Ÿ“ฉ Expanded message support for:
67
+ ### ๐Ÿ“จ Messages Handling & Compatibility
68
+ - ๐Ÿ“ฉ Expanded messages support for:
64
69
  - ๐Ÿ–ผ๏ธ [Album Message](#%EF%B8%8F-album-image--video)
65
70
  - ๐Ÿ‘ค [Group Status Message](#4%EF%B8%8Fโƒฃ-group-status)
66
71
  - ๐Ÿ‘‰๐Ÿป [Interactive Message](#-sending-interactive-messages) (buttons, lists, native flows, templates, carousels).
@@ -82,10 +87,68 @@ Hi everyone,
82
87
  - ๐Ÿ”’ [`secureMetaServiceLabel`](#6%EF%B8%8Fโƒฃ-secure-meta-service-label) - Secure meta service label on message **[NEW]**
83
88
  - ๐Ÿ“„ [`raw`](#5%EF%B8%8Fโƒฃ-raw) - Build your message manually **(DO NOT USE FOR EXPLOITATION)**
84
89
 
85
- > [!NOTE]
86
- ๐Ÿ“„ This project is maintained with limited scope and is not intended to replace upstream Baileys.
87
- >
88
- > ๐Ÿ˜ž And, really sorry for my bad english.
90
+ ### ๐Ÿ“‹ Index
91
+ - [๐Ÿ“ฅ Installation](#-installation)
92
+ - [๐Ÿงฉ Import (ESM & CJS)](#-import-esm--cjs)
93
+ - [๐ŸŒ Connect to WhatsApp (Quick Step)](#-connect-to-whatsapp-quick-step)
94
+ - [๐Ÿ—„๏ธ Implementing Data Store](#%EF%B8%8F-implementing-data-store)
95
+ - [๐Ÿชช WhatsApp IDs Explain](#-whatsapp-ids-explain)
96
+ - [โœ‰๏ธ Sending Messages](#%EF%B8%8F-sending-messages)
97
+ - [๐Ÿ”  Text](#-text)
98
+ - [๐Ÿ”” Mention](#-mention)
99
+ - [๐Ÿ˜ Reaction](#-reaction)
100
+ - [๐Ÿ“Œ Pin Message](#-pin-message)
101
+ - [โžก๏ธ Forward Message](#%EF%B8%8F-forward-message)
102
+ - [๐Ÿ‘ค Contact](#-contact)
103
+ - [๐Ÿ“ Location](#-location)
104
+ - [๐Ÿ—“๏ธ Event](#%EF%B8%8F-event)
105
+ - [๐Ÿ‘ฅ Group Invite](#-group-invite)
106
+ - [๐Ÿ›๏ธ Product](#%EF%B8%8F-product)
107
+ - [๐Ÿ“Š Poll](#-poll)
108
+ - [๐Ÿ’ญ Button Response](#-button-response)
109
+ - [โœจ Rich Response](#-rich-response)
110
+ - [๐Ÿงพ Message with Code Block](#-message-with-code-block)
111
+ - [๐Ÿ“‹ Message with Table](#-message-with-table)
112
+ - [๐ŸŽž๏ธ Status Mention](#%EF%B8%8F-status-mention)
113
+ - [๐Ÿ“ Sending Media Messages](#-sending-media-messages)
114
+ - [๐Ÿ–ผ๏ธ Image](#%EF%B8%8F-image)
115
+ - [๐ŸŽฅ Video](#-video)
116
+ - [๐Ÿ“ƒ Sticker](#-sticker)
117
+ - [๐Ÿ’ฝ Audio](#-audio)
118
+ - [๐Ÿ—‚๏ธ Document](#%EF%B8%8F-document)
119
+ - [๐Ÿ–ผ๏ธ Album (Image & Video)](#%EF%B8%8F-album-image--video)
120
+ - [๐Ÿ“ฆ Sticker Pack](#-sticker-pack)
121
+ - [๐Ÿ‘‰๐Ÿป Sending Interactive Messages](#-sending-interactive-messages)
122
+ - [1๏ธโƒฃ Buttons](#1%EF%B8%8Fโƒฃ-buttons)
123
+ - [2๏ธโƒฃ List](#2%EF%B8%8Fโƒฃ-list)
124
+ - [3๏ธโƒฃ Interactive](#3%EF%B8%8Fโƒฃ-interactive)
125
+ - [4๏ธโƒฃ Hydrated Template](#4%EF%B8%8Fโƒฃ-hydrated-template)
126
+ - [๐Ÿ’ณ Sending Payment Messages](#-sending-payment-messages)
127
+ - [1๏ธโƒฃ Invite Payment](#1%EF%B8%8Fโƒฃ-invite-payment)
128
+ - [2๏ธโƒฃ Invoice](#2%EF%B8%8Fโƒฃ-invoice)
129
+ - [3๏ธโƒฃ Order](#3%EF%B8%8Fโƒฃ-order)
130
+ - [4๏ธโƒฃ Request Payment](#4%EF%B8%8Fโƒฃ-request-payment)
131
+ - [๐Ÿ‘๏ธ Other Message Options](#%EF%B8%8F-other-message-options)
132
+ - [1๏ธโƒฃ AI Icon](#1%EF%B8%8Fโƒฃ-ai-icon)
133
+ - [2๏ธโƒฃ Ephemeral](#2%EF%B8%8Fโƒฃ-ephemeral)
134
+ - [3๏ธโƒฃ External Ad Reply](#3%EF%B8%8Fโƒฃ-external-ad-reply)
135
+ - [4๏ธโƒฃ Group Status](#4%EF%B8%8Fโƒฃ-group-status)
136
+ - [5๏ธโƒฃ Raw](#5%EF%B8%8Fโƒฃ-raw)
137
+ - [6๏ธโƒฃ Secure Meta Service Label](#6%EF%B8%8Fโƒฃ-secure-meta-service-label)
138
+ - [7๏ธโƒฃ View Once](#7%EF%B8%8Fโƒฃ-view-once)
139
+ - [8๏ธโƒฃ View Once V2](#8%EF%B8%8Fโƒฃ-view-once-v2)
140
+ - [9๏ธโƒฃ View Once V2 Extension](#9%EF%B8%8Fโƒฃ-view-once-v2-extension)
141
+ - [โ™ป๏ธ Modify Messages](#%EF%B8%8F-modify-messages)
142
+ - [๐Ÿ—‘๏ธ Delete Messages](#%EF%B8%8F-delete-messages)
143
+ - [โœ๏ธ Edit Messages](#%EF%B8%8F-edit-messages)
144
+ - [๐Ÿงฐ Additional Contents](#-additional-contents)
145
+ - [๐Ÿท๏ธ Find User ID (JID|PN/LID)](#%EF%B8%8F-find-user-id-jidpnlid)
146
+ - [๐Ÿ”‘ Request Custom Pairing Code](#-request-custom-pairing-code)
147
+ - [๐Ÿ–ผ๏ธ Image Processing](#%EF%B8%8F-image-processing)
148
+ - [๐Ÿ“ฃ Newsletter Management](#-newsletter-management)
149
+ - [๐Ÿ‘ฅ Group Management](#-group-management)
150
+ - [๐Ÿ“ฆ Fork Base](#-fork-base)
151
+ - [๐Ÿ“ฃ Credits](#-credits)
89
152
 
90
153
  ### ๐Ÿ“ฅ Installation
91
154
 
@@ -322,6 +385,15 @@ sock.sendMessage(jid, {
322
385
  })
323
386
  ```
324
387
 
388
+ #### โžก๏ธ Forward Message
389
+
390
+ ```javascript
391
+ sock.sendMessage(jid, {
392
+ forward: message,
393
+ force: true // --- Optional
394
+ })
395
+ ```
396
+
325
397
  #### ๐Ÿ‘ค Contact
326
398
 
327
399
  ```javascript
@@ -382,6 +454,55 @@ sock.sendMessage(jid, {
382
454
  })
383
455
  ```
384
456
 
457
+ #### ๐Ÿ‘ฅ Group Invite
458
+
459
+ ```javascript
460
+ const inviteCode = groupUrl
461
+ .split('chat.whatsapp.com/')[1]
462
+ ?.split('?')[0]
463
+
464
+ const groupJid = '1201111111111@g.us'
465
+ const groupName = '@itsliaaa/baileys'
466
+
467
+ sock.sendMessage(jid, {
468
+ groupInvite: {
469
+ inviteCode,
470
+ inviteExpiration: Date.now() + 86400000,
471
+ text: '๐Ÿ‘‹๐Ÿป Hello, we invite you to join our group.',
472
+ jid: groupJid,
473
+ subject: groupName,
474
+ }
475
+ }, {
476
+ quoted: message
477
+ })
478
+ ```
479
+
480
+ #### ๐Ÿ›๏ธ Product
481
+
482
+ ```javascript
483
+ import { randomUUID } from 'crypto'
484
+
485
+ sock.sendMessage(jid, {
486
+ image: {
487
+ url: './path/to/image.jpg'
488
+ },
489
+ body: '๐Ÿ‘‹๐Ÿป Check my product here!',
490
+ footer: '@itsliaaa/baileys',
491
+ product: {
492
+ currencyCode: 'IDR',
493
+ description: '๐Ÿ›๏ธ Interesting product!',
494
+ priceAmount1000: 70_000_000,
495
+ productId: randomUUID(),
496
+ productImageCount: 1,
497
+ salePriceAmount1000: 65_000_000,
498
+ signedUrl: 'https://www.npmjs.com/package/@itsliaaa/baileys',
499
+ title: '๐Ÿ“ฆ Starseed (Premium)',
500
+ url: 'https://www.npmjs.com/package/@itsliaaa/baileys'
501
+ },
502
+ businessOwnerJid: '0@s.whatsapp.net'
503
+ })
504
+ ```
505
+
385
506
  #### ๐Ÿ“Š Poll
386
507
 
387
508
  ```javascript
@@ -441,7 +562,7 @@ sock.sendMessage(jid, {
441
562
  })
442
563
  ```
443
564
 
444
- #### ๐Ÿ’ญ Response
565
+ #### ๐Ÿ’ญ Button Response
445
566
 
446
567
  ```javascript
447
568
  // --- Using buttonsResponseMessage
@@ -653,6 +774,20 @@ sock.sendMessage(jid, {
653
774
  })
654
775
  ```
655
776
 
777
+ #### ๐Ÿ—‚๏ธ Document
778
+
779
+ ```javascript
780
+ sock.sendMessage(jid, {
781
+ document: {
782
+ url: './path/to/document.pdf'
783
+ },
784
+ mimetype: 'application/pdf',
785
+ caption: 'โœจ My work!'
786
+ }, {
787
+ quoted: message
788
+ })
789
+ ```
790
+
656
791
  #### ๐Ÿ–ผ๏ธ Album (Image & Video)
657
792
 
658
793
  ```javascript
@@ -806,7 +941,7 @@ sock.sendMessage(jid, {
806
941
  image: {
807
942
  url: './path/to/image.jpg'
808
943
  },
809
- caption: '๐Ÿ—„๏ธ Interactive!',
944
+ caption: '??๏ธ Interactive!',
810
945
  footer: '@itsliaaa/baileys',
811
946
  optionText: '๐Ÿ‘‰๐Ÿป Select Options', // --- Optional, wrap all native flow into a single list
812
947
  optionTitle: '๐Ÿ“„ Select Options', // --- Optional
@@ -970,23 +1105,7 @@ sock.sendMessage(chat, {
970
1105
  })
971
1106
  ```
972
1107
 
973
- #### 4๏ธโƒฃ Product
974
-
975
- ```javascript
976
- sock.sendMessage(jid, {
977
- image: {
978
- url: './path/to/image.jpg'
979
- },
980
- product: {
981
- title: '๐Ÿ›’ My Product'
982
- },
983
- businessOwnerJid: '0@s.whatsapp.net' // --- Must included
984
- }, {
985
- quoted: message
986
- })
987
- ```
988
-
989
- #### 5๏ธโƒฃ Request Payment
1108
+ #### 4๏ธโƒฃ Request Payment
990
1109
 
991
1110
  ```javascript
992
1111
  sock.sendMessage(jid, {
@@ -1140,6 +1259,32 @@ sock.sendMessage(jid, {
1140
1259
  })
1141
1260
  ```
1142
1261
 
1262
+ ### โ™ป๏ธ Modify Messages
1263
+
1264
+ #### ๐Ÿ—‘๏ธ Delete Messages
1265
+
1266
+ ```javascript
1267
+ sock.sendMessage(jid, {
1268
+ delete: message.key
1269
+ })
1270
+ ```
1271
+
1272
+ #### โœ๏ธ Edit Messages
1273
+
1274
+ ```javascript
1275
+ // --- Edit plain text
1276
+ sock.sendMessage(jid, {
1277
+ text: 'โœจ I mean, nice!',
1278
+ edit: message.key
1279
+ })
1280
+
1281
+ // --- Edit media messages caption
1282
+ sock.sendMessage(jid, {
1283
+ caption: 'โœจ I mean, here is the image!',
1284
+ edit: message.key
1285
+ })
1286
+ ```
1287
+
1143
1288
  ### ๐Ÿงฐ Additional Contents
1144
1289
 
1145
1290
  #### ๐Ÿท๏ธ Find User ID (JID|PN/LID)