@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 +170 -25
- package/WAProto/index.js +380 -0
- package/lib/Defaults/index.js +1 -1
- package/lib/Utils/generics.js +1 -1
- package/lib/Utils/messages.js +220 -269
- package/lib/Utils/use-single-file-auth-state.js +31 -15
- package/package.json +1 -1
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
|
-
### ๐จ
|
|
63
|
-
- ๐ฉ Expanded
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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: '
|
|
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๏ธโฃ
|
|
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)
|