@jiancodes/baileys 2.0.4 → 2.0.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 +90 -388
- package/WAProto/fix-import.js +29 -0
- package/WAProto/index.js +65432 -137443
- package/lib/Defaults/index.js +6 -6
- package/lib/Socket/chats.js +15 -28
- package/lib/Socket/dugong.js +2 -4
- package/lib/Socket/luxu.js +620 -0
- package/lib/Socket/messages-send.js +21 -14
- package/lib/Socket/socket.js +1 -1
- package/lib/Utils/generics.js +3 -3
- package/lib/Utils/messages.js +32 -0
- package/lib/index.js.bak +45 -0
- package/package.json +11 -14
- package/lib/Defaults/index.d.ts +0 -53
- package/lib/Signal/Group/ciphertext-message.d.ts +0 -9
- package/lib/Signal/Group/group-session-builder.d.ts +0 -14
- package/lib/Signal/Group/group_cipher.d.ts +0 -17
- package/lib/Signal/Group/index.d.ts +0 -11
- package/lib/Signal/Group/keyhelper.d.ts +0 -10
- package/lib/Signal/Group/queue-job.d.ts +0 -1
- package/lib/Signal/Group/sender-chain-key.d.ts +0 -13
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +0 -16
- package/lib/Signal/Group/sender-key-message.d.ts +0 -18
- package/lib/Signal/Group/sender-key-name.d.ts +0 -17
- package/lib/Signal/Group/sender-key-record.d.ts +0 -30
- package/lib/Signal/Group/sender-key-state.d.ts +0 -38
- package/lib/Signal/Group/sender-message-key.d.ts +0 -11
- package/lib/Signal/libsignal.d.ts +0 -3
- package/lib/Socket/Client/abstract-socket-client.d.ts +0 -17
- package/lib/Socket/Client/index.d.ts +0 -3
- package/lib/Socket/Client/mobile-socket-client.d.ts +0 -13
- package/lib/Socket/Client/web-socket-client.d.ts +0 -12
- package/lib/Socket/business.d.ts +0 -171
- package/lib/Socket/chats.d.ts +0 -267
- package/lib/Socket/dugong.d.ts +0 -254
- package/lib/Socket/groups.d.ts +0 -115
- package/lib/Socket/index.d.ts +0 -173
- package/lib/Socket/messages-recv.d.ts +0 -161
- package/lib/Socket/newsletter.d.ts +0 -134
- package/lib/Socket/registration.d.ts +0 -267
- package/lib/Socket/socket.d.ts +0 -43
- package/lib/Socket/usync.d.ts +0 -36
- package/lib/Store/index.d.ts +0 -3
- package/lib/Store/make-cache-manager-store.d.ts +0 -13
- package/lib/Store/make-in-memory-store.d.ts +0 -118
- package/lib/Store/make-ordered-dictionary.d.ts +0 -13
- package/lib/Store/object-repository.d.ts +0 -10
- package/lib/Types/Auth.d.ts +0 -110
- package/lib/Types/Call.d.ts +0 -13
- package/lib/Types/Contact.d.ts +0 -19
- package/lib/Types/Events.d.ts +0 -157
- package/lib/Types/GroupMetadata.d.ts +0 -55
- package/lib/Types/Label.d.ts +0 -35
- package/lib/Types/LabelAssociation.d.ts +0 -29
- package/lib/Types/Message.d.ts +0 -273
- package/lib/Types/Newsletter.d.ts +0 -103
- package/lib/Types/Product.d.ts +0 -78
- package/lib/Types/Signal.d.ts +0 -57
- package/lib/Types/Socket.d.ts +0 -111
- package/lib/Types/State.d.ts +0 -27
- package/lib/Types/USync.d.ts +0 -25
- package/lib/Types/index.d.ts +0 -57
- package/lib/Utils/auth-utils.d.ts +0 -18
- package/lib/Utils/baileys-event-stream.d.ts +0 -16
- package/lib/Utils/business.d.ts +0 -22
- package/lib/Utils/chat-utils.d.ts +0 -71
- package/lib/Utils/crypto.d.ts +0 -41
- package/lib/Utils/decode-wa-message.d.ts +0 -19
- package/lib/Utils/event-buffer.d.ts +0 -35
- package/lib/Utils/generics.d.ts +0 -92
- package/lib/Utils/history.d.ts +0 -15
- package/lib/Utils/index.d.ts +0 -17
- package/lib/Utils/link-preview.d.ts +0 -21
- package/lib/Utils/logger.d.ts +0 -4
- package/lib/Utils/lt-hash.d.ts +0 -12
- package/lib/Utils/make-mutex.d.ts +0 -7
- package/lib/Utils/messages-media.d.ts +0 -116
- package/lib/Utils/messages.d.ts +0 -77
- package/lib/Utils/noise-handler.d.ts +0 -21
- package/lib/Utils/process-message.d.ts +0 -41
- package/lib/Utils/signal.d.ts +0 -32
- package/lib/Utils/use-multi-file-auth-state.d.ts +0 -13
- package/lib/Utils/validate-connection.d.ts +0 -11
- package/lib/WABinary/constants.d.ts +0 -30
- package/lib/WABinary/decode.d.ts +0 -7
- package/lib/WABinary/encode.d.ts +0 -3
- package/lib/WABinary/generic-utils.d.ts +0 -17
- package/lib/WABinary/index.d.ts +0 -5
- package/lib/WABinary/jid-utils.d.ts +0 -31
- package/lib/WABinary/types.d.ts +0 -18
- package/lib/WAM/BinaryInfo.d.ts +0 -17
- package/lib/WAM/constants.d.ts +0 -38
- package/lib/WAM/encode.d.ts +0 -3
- package/lib/WAM/index.d.ts +0 -3
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -9
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -22
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -12
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -12
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -25
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -8
- package/lib/WAUSync/Protocols/index.d.ts +0 -4
- package/lib/WAUSync/USyncQuery.d.ts +0 -28
- package/lib/WAUSync/USyncUser.d.ts +0 -12
- package/lib/WAUSync/index.d.ts +0 -3
- package/lib/index.d.ts +0 -12
package/README.md
CHANGED
|
@@ -1,393 +1,95 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
<img src="https://files.catbox.moe/369pux.jpg" alt="Thumbnail" />
|
|
1
|
+
# Modified Whatsapp-API
|
|
2
|
+
<p align='center'>
|
|
3
|
+
<img src="https://uploader.zenzxz.dpdns.org/uploads/1769165418349.jpeg" width="172">
|
|
5
4
|
</p>
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
await sock.newsletterId(url)
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Check banned number
|
|
44
|
-
You can see the status of blocked numbers here
|
|
45
|
-
|
|
46
|
-
```javascript
|
|
47
|
-
await sock.checkWhatsApp(jid)
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## SendMessage Documentation
|
|
53
|
-
|
|
54
|
-
### Status Group Message V2
|
|
55
|
-
Send group status with version 2
|
|
56
|
-
|
|
57
|
-
```javascript
|
|
58
|
-
await sock.sendMessage(jid, {
|
|
59
|
-
groupStatusMessage: {
|
|
60
|
-
text: "Hello World"
|
|
61
|
-
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
```json
|
|
10
|
+
"depencies": {
|
|
11
|
+
"@whiskeysockets/baileys": "npm:@jiancodes/baileys"
|
|
12
|
+
}
|
|
13
|
+
Import
|
|
14
|
+
const {
|
|
15
|
+
default:makeWASocket,
|
|
16
|
+
// Other Options
|
|
17
|
+
} = require('@whiskeysockets/baileys');
|
|
18
|
+
How To Connect To Whatsapp
|
|
19
|
+
With QR Code
|
|
20
|
+
const {
|
|
21
|
+
default: makeWASocket
|
|
22
|
+
} = require('@whiskeysockets/baileys');
|
|
23
|
+
|
|
24
|
+
const client = makeWASocket({
|
|
25
|
+
browser: ['Ubuntu', 'Chrome', '20.00.1'],
|
|
26
|
+
printQRInTerminal: true
|
|
27
|
+
})
|
|
28
|
+
Connect With Number
|
|
29
|
+
const {
|
|
30
|
+
default: makeWASocket,
|
|
31
|
+
fetchLatestWAWebVersion
|
|
32
|
+
} = require('@whiskeysockets/baileys');
|
|
33
|
+
|
|
34
|
+
const client = makeWASocket({
|
|
35
|
+
browser: ['Ubuntu', 'Chrome', '20.00.1'],
|
|
36
|
+
printQRInTerminal: false,
|
|
37
|
+
version: fetchLatestWAWebVersion()
|
|
38
|
+
// Other options
|
|
62
39
|
});
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Album Message (Multiple Images)
|
|
66
|
-
Send multiple images in a single album message:
|
|
67
|
-
|
|
68
|
-
```javascript
|
|
69
|
-
await sock.sendMessage(jid, {
|
|
70
|
-
albumMessage: [
|
|
71
|
-
{ image: cihuy, caption: "Foto pertama" },
|
|
72
|
-
{ image: { url: "URL IMAGE" }, caption: "Foto kedua" }
|
|
73
|
-
]
|
|
74
|
-
}, { quoted: m });
|
|
75
|
-
```
|
|
76
40
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
optionName: "TEST 1",
|
|
109
|
-
optionVoteCount: "112233"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
optionName: "TEST 2",
|
|
113
|
-
optionVoteCount: "1"
|
|
114
|
-
}
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
}, { quoted: m });
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Simple Interactive Message
|
|
121
|
-
Send basic interactive messages with copy button functionality:
|
|
122
|
-
|
|
123
|
-
```javascript
|
|
124
|
-
await sock.sendMessage(jid, {
|
|
125
|
-
interactiveMessage: {
|
|
126
|
-
header: "Hello World",
|
|
127
|
-
title: "Hello World",
|
|
128
|
-
footer: "telegram: @yumevtc ",
|
|
129
|
-
buttons: [
|
|
130
|
-
{
|
|
131
|
-
name: "cta_copy",
|
|
132
|
-
buttonParamsJson: JSON.stringify({
|
|
133
|
-
display_text: "copy code",
|
|
134
|
-
id: "123456789",
|
|
135
|
-
copy_code: "ABC123XYZ"
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
]
|
|
41
|
+
const number = "628XXXXX";
|
|
42
|
+
const code = await client.requestPairingCode(number.trim) /* Use : (number, "YYYYYYYY") for custom-pairing */
|
|
43
|
+
|
|
44
|
+
console.log("Ur pairing code : " + code)
|
|
45
|
+
Sending messages
|
|
46
|
+
send orderMessage
|
|
47
|
+
const fs = require('fs');
|
|
48
|
+
const ZeppImg = fs.readFileSync('./ZeppImage');
|
|
49
|
+
|
|
50
|
+
await client.sendMessage(m.chat, {
|
|
51
|
+
thumbnail: Jianimg,
|
|
52
|
+
message: "Gotta get a grip",
|
|
53
|
+
orderTitle: "jiancodes-Corporation",
|
|
54
|
+
totalAmount1000: 72502,
|
|
55
|
+
totalCurrencyCode: "IDR"
|
|
56
|
+
}, { quoted:m })
|
|
57
|
+
send pollResultSnapshotMessage
|
|
58
|
+
await client.sendMessage(m.chat, {
|
|
59
|
+
pollResultMessage: {
|
|
60
|
+
name: "jiancodes-Corporation",
|
|
61
|
+
options: [
|
|
62
|
+
{
|
|
63
|
+
optionName: "poll 1"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
optionName: "poll 2"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
newsletter: {
|
|
70
|
+
newsletterName: "Faa About Infomation",
|
|
71
|
+
newsletterJid: "1@newsletter"
|
|
139
72
|
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
divider_indices: [1, 2, 3, 4, 5, 999],
|
|
164
|
-
list_title: "yume native",
|
|
165
|
-
button_title: "yume native"
|
|
166
|
-
},
|
|
167
|
-
tap_target_configuration: {
|
|
168
|
-
title: " X ",
|
|
169
|
-
description: "bomboclard",
|
|
170
|
-
canonical_url: "https://t.me/yumevtc",
|
|
171
|
-
domain: "shop.example.com",
|
|
172
|
-
button_index: 0
|
|
173
|
-
}
|
|
174
|
-
}),
|
|
175
|
-
buttons: [
|
|
176
|
-
{
|
|
177
|
-
name: "single_select",
|
|
178
|
-
buttonParamsJson: JSON.stringify({
|
|
179
|
-
has_multiple_buttons: true
|
|
180
|
-
})
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
name: "call_permission_request",
|
|
184
|
-
buttonParamsJson: JSON.stringify({
|
|
185
|
-
has_multiple_buttons: true
|
|
186
|
-
})
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
name: "single_select",
|
|
190
|
-
buttonParamsJson: JSON.stringify({
|
|
191
|
-
title: "Hello World",
|
|
192
|
-
sections: [
|
|
193
|
-
{
|
|
194
|
-
title: "title",
|
|
195
|
-
highlight_label: "label",
|
|
196
|
-
rows: [
|
|
197
|
-
{
|
|
198
|
-
title: "@yumevtc",
|
|
199
|
-
description: "love you",
|
|
200
|
-
id: "row_2"
|
|
201
|
-
}
|
|
202
|
-
]
|
|
203
|
-
}
|
|
204
|
-
],
|
|
205
|
-
has_multiple_buttons: true
|
|
206
|
-
})
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
name: "cta_copy",
|
|
210
|
-
buttonParamsJson: JSON.stringify({
|
|
211
|
-
display_text: "copy code",
|
|
212
|
-
id: "123456789",
|
|
213
|
-
copy_code: "ABC123XYZ"
|
|
214
|
-
})
|
|
215
|
-
}
|
|
216
|
-
]
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}, { quoted: m });
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### Interactive Message with Thumbnail
|
|
223
|
-
Send interactive messages with thumbnail image and copy button:
|
|
224
|
-
|
|
225
|
-
```javascript
|
|
226
|
-
await sock.sendMessage(jid, {
|
|
227
|
-
interactiveMessage: {
|
|
228
|
-
header: "Hello World",
|
|
229
|
-
title: "Hello World",
|
|
230
|
-
footer: "telegram: @yumevtc",
|
|
231
|
-
image: { url: "https://example.com/image.jpg" },
|
|
232
|
-
buttons: [
|
|
233
|
-
{
|
|
234
|
-
name: "cta_copy",
|
|
235
|
-
buttonParamsJson: JSON.stringify({
|
|
236
|
-
display_text: "copy code",
|
|
237
|
-
id: "123456789",
|
|
238
|
-
copy_code: "ABC123XYZ"
|
|
239
|
-
})
|
|
240
|
-
}
|
|
241
|
-
]
|
|
242
|
-
}
|
|
243
|
-
}, { quoted: m });
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
### Product Message
|
|
247
|
-
Send product catalog messages with buttons and merchant information:
|
|
248
|
-
|
|
249
|
-
```javascript
|
|
250
|
-
await sock.sendMessage(jid, {
|
|
251
|
-
productMessage: {
|
|
252
|
-
title: "Produk Contoh",
|
|
253
|
-
description: "Ini adalah deskripsi produk",
|
|
254
|
-
thumbnail: { url: "https://example.com/image.jpg" },
|
|
255
|
-
productId: "PROD001",
|
|
256
|
-
retailerId: "RETAIL001",
|
|
257
|
-
url: "https://example.com/product",
|
|
258
|
-
body: "Detail produk",
|
|
259
|
-
footer: "Harga spesial",
|
|
260
|
-
priceAmount1000: 50000,
|
|
261
|
-
currencyCode: "USD",
|
|
262
|
-
buttons: [
|
|
263
|
-
{
|
|
264
|
-
name: "cta_url",
|
|
265
|
-
buttonParamsJson: JSON.stringify({
|
|
266
|
-
display_text: "Beli Sekarang",
|
|
267
|
-
url: "https://example.com/buy"
|
|
268
|
-
})
|
|
269
|
-
}
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
}, { quoted: m });
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### Interactive Message with Document Buffer
|
|
276
|
-
Send interactive messages with document from buffer (file system) - **Note: Documents only support buffer**:
|
|
277
|
-
|
|
278
|
-
```javascript
|
|
279
|
-
await sock.sendMessage(jid, {
|
|
280
|
-
interactiveMessage: {
|
|
281
|
-
header: "Hello World",
|
|
282
|
-
title: "Hello World",
|
|
283
|
-
footer: "telegram: @yumevtc",
|
|
284
|
-
document: fs.readFileSync("./package.json"),
|
|
285
|
-
mimetype: "application/pdf",
|
|
286
|
-
fileName: "yumevtc.pdf",
|
|
287
|
-
jpegThumbnail: fs.readFileSync("./document.jpeg"),
|
|
288
|
-
contextInfo: {
|
|
289
|
-
mentionedJid: [jid],
|
|
290
|
-
forwardingScore: 777,
|
|
291
|
-
isForwarded: false
|
|
292
|
-
},
|
|
293
|
-
externalAdReply: {
|
|
294
|
-
title: "shenń Bot",
|
|
295
|
-
body: "anu team",
|
|
296
|
-
mediaType: 3,
|
|
297
|
-
thumbnailUrl: "https://example.com/image.jpg",
|
|
298
|
-
mediaUrl: " X ",
|
|
299
|
-
sourceUrl: "https://t.me/yumevtc",
|
|
300
|
-
showAdAttribution: true,
|
|
301
|
-
renderLargerThumbnail: false
|
|
302
|
-
},
|
|
303
|
-
buttons: [
|
|
304
|
-
{
|
|
305
|
-
name: "cta_url",
|
|
306
|
-
buttonParamsJson: JSON.stringify({
|
|
307
|
-
display_text: "Telegram",
|
|
308
|
-
url: "https://t.me/yumevtc",
|
|
309
|
-
merchant_url: "https://t.me/yumevtc"
|
|
310
|
-
})
|
|
311
|
-
}
|
|
312
|
-
]
|
|
313
|
-
}
|
|
314
|
-
}, { quoted: m });
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
### Interactive Message with Document Buffer (Simple)
|
|
318
|
-
Send interactive messages with document from buffer (file system) without contextInfo and externalAdReply - **Note: Documents only support buffer**:
|
|
319
|
-
|
|
320
|
-
```javascript
|
|
321
|
-
await sock.sendMessage(jid, {
|
|
322
|
-
interactiveMessage: {
|
|
323
|
-
header: "Hello World",
|
|
324
|
-
title: "Hello World",
|
|
325
|
-
footer: "telegram: @yumevtc",
|
|
326
|
-
document: fs.readFileSync("./package.json"),
|
|
327
|
-
mimetype: "application/pdf",
|
|
328
|
-
fileName: "yumevtc.pdf",
|
|
329
|
-
jpegThumbnail: fs.readFileSync("./document.jpeg"),
|
|
330
|
-
buttons: [
|
|
331
|
-
{
|
|
332
|
-
name: "cta_url",
|
|
333
|
-
buttonParamsJson: JSON.stringify({
|
|
334
|
-
display_text: "Telegram",
|
|
335
|
-
url: "https://t.me/yumevtc",
|
|
336
|
-
merchant_url: "https://t.me/yumevtc"
|
|
337
|
-
})
|
|
338
|
-
}
|
|
339
|
-
]
|
|
340
|
-
}
|
|
341
|
-
}, { quoted: m });
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
### Request Payment Message
|
|
345
|
-
Send payment request messages with custom background and sticker:
|
|
346
|
-
|
|
347
|
-
```javascript
|
|
348
|
-
let quotedType = m.quoted?.mtype || '';
|
|
349
|
-
let quotedContent = JSON.stringify({ [quotedType]: m.quoted }, null, 2);
|
|
350
|
-
|
|
351
|
-
await sock.sendMessage(jid, {
|
|
352
|
-
requestPaymentMessage: {
|
|
353
|
-
currency: "IDR",
|
|
354
|
-
amount: 10000000,
|
|
355
|
-
from: m.sender,
|
|
356
|
-
sticker: JSON.parse(quotedContent),
|
|
357
|
-
background: {
|
|
358
|
-
id: "100",
|
|
359
|
-
fileLength: "0",
|
|
360
|
-
width: 1000,
|
|
361
|
-
height: 1000,
|
|
362
|
-
mimetype: "image/webp",
|
|
363
|
-
placeholderArgb: 0xFF00FFFF,
|
|
364
|
-
textArgb: 0xFFFFFFFF,
|
|
365
|
-
subtextArgb: 0xFFAA00FF
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}, { quoted: m });
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
---
|
|
372
|
-
|
|
373
|
-
## Why Choose WhatsApp Baileys?
|
|
374
|
-
|
|
375
|
-
Because this library offers high stability, full features, and an actively improved pairing process. It is ideal for developers aiming to create professional and secure WhatsApp automation solutions. Support for the latest WhatsApp features ensures compatibility with platform updates.
|
|
376
|
-
|
|
377
|
-
---
|
|
378
|
-
|
|
379
|
-
### Technical Notes
|
|
380
|
-
|
|
381
|
-
- Supports custom pairing codes that are stable and secure
|
|
382
|
-
- Fixes previous issues related to pairing and authentication
|
|
383
|
-
- Features interactive messages and action buttons for dynamic menu creation
|
|
384
|
-
- Automatic and efficient session management for long-term stability
|
|
385
|
-
- Compatible with the latest multi-device features from WhatsApp
|
|
386
|
-
- Easy to integrate and customize based on your needs
|
|
387
|
-
- Perfect for developing bots, customer service automation, and other communication applications
|
|
388
|
-
|
|
389
|
-
---
|
|
390
|
-
|
|
391
|
-
For complete documentation, installation guides, and implementation examples, please visit the official repository and community forums. We continually update and improve this library to meet the needs of developers and users of modern WhatsApp automation solutions.
|
|
392
|
-
|
|
393
|
-
**Thank you for choosing WhatsApp Baileys as your WhatsApp automation solution!**
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
send productMessage
|
|
76
|
+
await client.relayMessage(m.chat, {
|
|
77
|
+
productMessage {
|
|
78
|
+
title: "jiancodes.pdf",
|
|
79
|
+
description: "Faa...",
|
|
80
|
+
thumbnail: { url: "./JianImage" },
|
|
81
|
+
productId: "EXAMPLE_TOKEN",
|
|
82
|
+
retailerId: "EXAMPLE_RETAILER_ID",
|
|
83
|
+
url: "https://t.me/jiancodes",
|
|
84
|
+
body: "Nak Tido",
|
|
85
|
+
footer: "Footer",
|
|
86
|
+
buttons: [
|
|
87
|
+
{
|
|
88
|
+
name: "cta_url",
|
|
89
|
+
buttonParamsJson: "{\"display_text\":\"jiancodes\",\"url\":\"https://t.me/jiancodes\"}"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
priceAmount1000: 72502,
|
|
93
|
+
currencyCode: "IDR"
|
|
94
|
+
}
|
|
95
|
+
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const { readFileSync, writeFileSync } = require 'fs';
|
|
2
|
+
const { exit } = require 'process';
|
|
3
|
+
|
|
4
|
+
const filePath = './index.js';
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
// Read the file
|
|
8
|
+
let content = readFileSync(filePath, 'utf8');
|
|
9
|
+
|
|
10
|
+
// Fix the import statement
|
|
11
|
+
content = content.replace(
|
|
12
|
+
/import \* as (\$protobuf) from/g,
|
|
13
|
+
'import $1 from'
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
// add missing extension to the import
|
|
17
|
+
content = content.replace(
|
|
18
|
+
/(['"])protobufjs\/minimal(['"])/g,
|
|
19
|
+
'$1protobufjs/minimal.js$2'
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
// Write back
|
|
23
|
+
writeFileSync(filePath, content, 'utf8');
|
|
24
|
+
|
|
25
|
+
console.log(`✅ Fixed imports in ${filePath}`);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error(`❌ Error fixing imports: ${error.message}`);
|
|
28
|
+
exit(1);
|
|
29
|
+
}
|