vanzdev 3.0.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/LICENSE +21 -0
- package/README.MD +603 -0
- package/WAProto/GenerateStatics.sh +4 -0
- package/WAProto/WAProto.proto +5479 -0
- package/WAProto/index.js +97692 -0
- package/WAProto/p.html +1 -0
- package/engine-requirements.js +10 -0
- package/lib/Defaults/index.js +120 -0
- package/lib/Defaults/wileys-version.json +3 -0
- package/lib/Signal/Group/ciphertext-message.js +15 -0
- package/lib/Signal/Group/group-session-builder.js +64 -0
- package/lib/Signal/Group/group_cipher.js +96 -0
- package/lib/Signal/Group/index.js +57 -0
- package/lib/Signal/Group/keyhelper.js +55 -0
- package/lib/Signal/Group/queue-job.js +57 -0
- package/lib/Signal/Group/sender-chain-key.js +34 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js +69 -0
- package/lib/Signal/Group/sender-key-name.js +51 -0
- package/lib/Signal/Group/sender-key-record.js +53 -0
- package/lib/Signal/Group/sender-key-state.js +99 -0
- package/lib/Signal/Group/sender-message-key.js +29 -0
- package/lib/Signal/libsignal.js +184 -0
- package/lib/Socket/Client/index.js +18 -0
- package/lib/Socket/Client/types.js +13 -0
- package/lib/Socket/Client/websocket.js +72 -0
- package/lib/Socket/business.js +260 -0
- package/lib/Socket/chats.js +997 -0
- package/lib/Socket/groups.js +332 -0
- package/lib/Socket/index.js +10 -0
- package/lib/Socket/messages-recv.js +1155 -0
- package/lib/Socket/messages-send.js +913 -0
- package/lib/Socket/newsletter.js +283 -0
- package/lib/Socket/socket.js +714 -0
- package/lib/Socket/usync.js +70 -0
- package/lib/Store/index.js +8 -0
- package/lib/Store/make-in-memory-store.js +439 -0
- package/lib/Store/make-ordered-dictionary.js +81 -0
- package/lib/Store/object-repository.js +27 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.js +4 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.js +27 -0
- package/lib/Types/LabelAssociation.js +9 -0
- package/lib/Types/Message.js +7 -0
- package/lib/Types/Newsletter.js +18 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/State.js +2 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.js +42 -0
- package/lib/Utils/auth-utils.js +199 -0
- package/lib/Utils/browser-utils.js +35 -0
- package/lib/Utils/business.js +234 -0
- package/lib/Utils/chat-utils.js +730 -0
- package/lib/Utils/crypto.js +193 -0
- package/lib/Utils/decode-wa-message.js +217 -0
- package/lib/Utils/event-buffer.js +518 -0
- package/lib/Utils/generics.js +467 -0
- package/lib/Utils/history.js +94 -0
- package/lib/Utils/index.js +35 -0
- package/lib/Utils/link-preview.js +126 -0
- package/lib/Utils/logger.js +7 -0
- package/lib/Utils/lt-hash.js +51 -0
- package/lib/Utils/make-mutex.js +43 -0
- package/lib/Utils/message-retry-manager.js +185 -0
- package/lib/Utils/messages-media.js +879 -0
- package/lib/Utils/messages.js +1828 -0
- package/lib/Utils/noise-handler.js +150 -0
- package/lib/Utils/process-message.js +404 -0
- package/lib/Utils/signal.js +153 -0
- package/lib/Utils/use-multi-file-auth-state.js +124 -0
- package/lib/Utils/validate-connection.js +229 -0
- package/lib/Utils/wileys-event-stream.js +63 -0
- package/lib/WABinary/constants.js +1303 -0
- package/lib/WABinary/decode.js +265 -0
- package/lib/WABinary/encode.js +250 -0
- package/lib/WABinary/generic-utils.js +110 -0
- package/lib/WABinary/index.js +21 -0
- package/lib/WABinary/jid-utils.js +85 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.js +13 -0
- package/lib/WAM/constants.js +15350 -0
- package/lib/WAM/encode.js +155 -0
- package/lib/WAM/index.js +19 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
- package/lib/WAUSync/Protocols/index.js +20 -0
- package/lib/WAUSync/USyncQuery.js +89 -0
- package/lib/WAUSync/USyncUser.js +26 -0
- package/lib/WAUSync/index.js +19 -0
- package/lib/index.js +94 -0
- package/package.json +119 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 levvleys
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.MD
ADDED
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="https://i.ibb.co.com/21vvCDjz/1785702006503.png" width="320"/>
|
|
4
|
+
|
|
5
|
+
# 🚀 Vanzz Baileys
|
|
6
|
+
|
|
7
|
+
### Modern WhatsApp Multi-Device API for Node.js
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<div align="center">
|
|
19
|
+
|
|
20
|
+
**Vanzz Baileys** adalah fork Baileys Multi-Device modern yang
|
|
21
|
+
dioptimalkan untuk developer bot WhatsApp, automation, dan aplikasi
|
|
22
|
+
berbasis Node.js.
|
|
23
|
+
|
|
24
|
+
Dengan peningkatan:
|
|
25
|
+
- ⚡ Performa lebih cepat
|
|
26
|
+
- 🆔 Automatic LID → PN JID Resolver
|
|
27
|
+
- 📱 Pairing Code Support
|
|
28
|
+
- 🎛️ Interactive Message Support
|
|
29
|
+
- 🔥 Native Flow Button
|
|
30
|
+
- 🚀 Optimasi Group Metadata
|
|
31
|
+
- 🔐 Session Management
|
|
32
|
+
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# ✨ Fitur Utama
|
|
38
|
+
|
|
39
|
+
## 🚀 Core
|
|
40
|
+
|
|
41
|
+
- WhatsApp Multi Device
|
|
42
|
+
- QR Login
|
|
43
|
+
- Pairing Code
|
|
44
|
+
- Custom Pairing Code
|
|
45
|
+
- Auto Reconnect
|
|
46
|
+
- Session Save
|
|
47
|
+
- Database Auth Support
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 🆔 Smart JID System
|
|
52
|
+
|
|
53
|
+
Vanzz Baileys otomatis menangani:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
123456789@lid
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
menjadi:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
628xxxx@s.whatsapp.net
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Tidak perlu mapping manual.
|
|
66
|
+
|
|
67
|
+
Support:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
@s.whatsapp.net
|
|
71
|
+
@g.us
|
|
72
|
+
@broadcast
|
|
73
|
+
@lid
|
|
74
|
+
@newsletter
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
# 📦 Installation
|
|
80
|
+
|
|
81
|
+
NPM:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm install vanzz-baileys
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Latest:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm install vanzz-baileys@latest
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Yarn:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
yarn add vanzz-baileys
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
# 🚀 Quick Start
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
const {
|
|
105
|
+
default: makeWASocket,
|
|
106
|
+
useMultiFileAuthState
|
|
107
|
+
} = require("vanzz-baileys")
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
async function start(){
|
|
111
|
+
|
|
112
|
+
const {state,saveCreds}
|
|
113
|
+
=
|
|
114
|
+
await useMultiFileAuthState(
|
|
115
|
+
"./session"
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
const sock =
|
|
120
|
+
makeWASocket({
|
|
121
|
+
|
|
122
|
+
auth:state,
|
|
123
|
+
|
|
124
|
+
printQRInTerminal:true,
|
|
125
|
+
|
|
126
|
+
browser:[
|
|
127
|
+
"Vanzz Bot",
|
|
128
|
+
"Chrome",
|
|
129
|
+
"1.0"
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
sock.ev.on(
|
|
136
|
+
"creds.update",
|
|
137
|
+
saveCreds
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
sock.ev.on(
|
|
142
|
+
"connection.update",
|
|
143
|
+
({connection})=>{
|
|
144
|
+
|
|
145
|
+
if(connection==="open"){
|
|
146
|
+
|
|
147
|
+
console.log(
|
|
148
|
+
"✅ Vanzz Connected"
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
start()
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
# 🔑 Pairing Code
|
|
164
|
+
|
|
165
|
+
Tanpa scan QR:
|
|
166
|
+
|
|
167
|
+
```javascript
|
|
168
|
+
const sock =
|
|
169
|
+
makeWASocket({
|
|
170
|
+
|
|
171
|
+
printQRInTerminal:false
|
|
172
|
+
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
if(!sock.authState.creds.registered){
|
|
177
|
+
|
|
178
|
+
const code =
|
|
179
|
+
await sock.requestPairingCode(
|
|
180
|
+
"628xxxxxxx"
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
console.log(
|
|
185
|
+
"PAIRING:",
|
|
186
|
+
code
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
# 🎛️ Interactive Single Select Button
|
|
195
|
+
|
|
196
|
+
Vanzz menggunakan format Native Flow terbaru.
|
|
197
|
+
|
|
198
|
+
Contoh:
|
|
199
|
+
|
|
200
|
+
```javascript
|
|
201
|
+
await sock.sendMessage(
|
|
202
|
+
jid,
|
|
203
|
+
{
|
|
204
|
+
|
|
205
|
+
text:
|
|
206
|
+
"Silahkan pilih menu",
|
|
207
|
+
|
|
208
|
+
footer:
|
|
209
|
+
"Vanzz Bot",
|
|
210
|
+
|
|
211
|
+
buttons:[
|
|
212
|
+
|
|
213
|
+
{
|
|
214
|
+
|
|
215
|
+
name:
|
|
216
|
+
"single_select",
|
|
217
|
+
|
|
218
|
+
buttonParamsJson:
|
|
219
|
+
|
|
220
|
+
JSON.stringify({
|
|
221
|
+
|
|
222
|
+
title:
|
|
223
|
+
"Menu Bot",
|
|
224
|
+
|
|
225
|
+
sections:[
|
|
226
|
+
|
|
227
|
+
{
|
|
228
|
+
|
|
229
|
+
title:
|
|
230
|
+
"Main Menu",
|
|
231
|
+
|
|
232
|
+
rows:[
|
|
233
|
+
|
|
234
|
+
{
|
|
235
|
+
|
|
236
|
+
title:
|
|
237
|
+
"Owner",
|
|
238
|
+
|
|
239
|
+
description:
|
|
240
|
+
"Kontak owner",
|
|
241
|
+
|
|
242
|
+
id:
|
|
243
|
+
"owner"
|
|
244
|
+
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
{
|
|
248
|
+
|
|
249
|
+
title:
|
|
250
|
+
"Ping",
|
|
251
|
+
|
|
252
|
+
description:
|
|
253
|
+
"Cek respon bot",
|
|
254
|
+
|
|
255
|
+
id:
|
|
256
|
+
"ping"
|
|
257
|
+
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
]
|
|
261
|
+
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
]
|
|
265
|
+
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
]
|
|
271
|
+
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Output:
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
┌───────────────┐
|
|
281
|
+
│ Menu Bot │
|
|
282
|
+
│ │
|
|
283
|
+
│ Owner │
|
|
284
|
+
│ Ping │
|
|
285
|
+
└───────────────┘
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Membaca response:
|
|
289
|
+
|
|
290
|
+
```javascript
|
|
291
|
+
const id =
|
|
292
|
+
m.message
|
|
293
|
+
.listResponseMessage
|
|
294
|
+
?.singleSelectReply
|
|
295
|
+
?.selectedRowId
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
console.log(id)
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Output:
|
|
302
|
+
|
|
303
|
+
```
|
|
304
|
+
owner
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
# 🖼️ Image + Single Select
|
|
310
|
+
|
|
311
|
+
```javascript
|
|
312
|
+
await sock.sendMessage(
|
|
313
|
+
jid,
|
|
314
|
+
{
|
|
315
|
+
|
|
316
|
+
image:{
|
|
317
|
+
url:
|
|
318
|
+
"https://example.com/image.jpg"
|
|
319
|
+
},
|
|
320
|
+
|
|
321
|
+
caption:
|
|
322
|
+
"Welcome To Vanzz",
|
|
323
|
+
|
|
324
|
+
buttons:[
|
|
325
|
+
|
|
326
|
+
{
|
|
327
|
+
|
|
328
|
+
name:
|
|
329
|
+
"single_select",
|
|
330
|
+
|
|
331
|
+
buttonParamsJson:
|
|
332
|
+
|
|
333
|
+
JSON.stringify({
|
|
334
|
+
|
|
335
|
+
title:
|
|
336
|
+
"Open Menu",
|
|
337
|
+
|
|
338
|
+
sections:[
|
|
339
|
+
|
|
340
|
+
{
|
|
341
|
+
|
|
342
|
+
title:
|
|
343
|
+
"Features",
|
|
344
|
+
|
|
345
|
+
rows:[
|
|
346
|
+
|
|
347
|
+
{
|
|
348
|
+
|
|
349
|
+
title:
|
|
350
|
+
"Download",
|
|
351
|
+
|
|
352
|
+
id:
|
|
353
|
+
"download"
|
|
354
|
+
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
]
|
|
358
|
+
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
]
|
|
362
|
+
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
]
|
|
368
|
+
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
)
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
# 💬 Send Message
|
|
377
|
+
|
|
378
|
+
## Text
|
|
379
|
+
|
|
380
|
+
```javascript
|
|
381
|
+
await sock.sendMessage(
|
|
382
|
+
jid,
|
|
383
|
+
{
|
|
384
|
+
text:
|
|
385
|
+
"Hello Vanzz"
|
|
386
|
+
}
|
|
387
|
+
)
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## Reply / Quoted
|
|
393
|
+
|
|
394
|
+
```javascript
|
|
395
|
+
await sock.sendMessage(
|
|
396
|
+
jid,
|
|
397
|
+
{
|
|
398
|
+
text:
|
|
399
|
+
"Balasan"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
quoted:m
|
|
403
|
+
}
|
|
404
|
+
)
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## Mention User
|
|
410
|
+
|
|
411
|
+
```javascript
|
|
412
|
+
await sock.sendMessage(
|
|
413
|
+
jid,
|
|
414
|
+
{
|
|
415
|
+
|
|
416
|
+
text:
|
|
417
|
+
"Hello @628xxx",
|
|
418
|
+
|
|
419
|
+
mentions:[
|
|
420
|
+
|
|
421
|
+
"628xxx@s.whatsapp.net"
|
|
422
|
+
|
|
423
|
+
]
|
|
424
|
+
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
)
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
# 🎵 Media
|
|
433
|
+
|
|
434
|
+
## Image
|
|
435
|
+
|
|
436
|
+
```javascript
|
|
437
|
+
await sock.sendMessage(
|
|
438
|
+
jid,
|
|
439
|
+
{
|
|
440
|
+
|
|
441
|
+
image:{
|
|
442
|
+
url:
|
|
443
|
+
"./image.png"
|
|
444
|
+
},
|
|
445
|
+
|
|
446
|
+
caption:
|
|
447
|
+
"Vanzz"
|
|
448
|
+
|
|
449
|
+
}
|
|
450
|
+
)
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
## Video
|
|
456
|
+
|
|
457
|
+
```javascript
|
|
458
|
+
await sock.sendMessage(
|
|
459
|
+
jid,
|
|
460
|
+
{
|
|
461
|
+
|
|
462
|
+
video:{
|
|
463
|
+
url:
|
|
464
|
+
"./video.mp4"
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## Audio
|
|
474
|
+
|
|
475
|
+
```javascript
|
|
476
|
+
await sock.sendMessage(
|
|
477
|
+
jid,
|
|
478
|
+
{
|
|
479
|
+
|
|
480
|
+
audio:{
|
|
481
|
+
url:
|
|
482
|
+
"./audio.mp3"
|
|
483
|
+
},
|
|
484
|
+
|
|
485
|
+
mimetype:
|
|
486
|
+
"audio/mp4"
|
|
487
|
+
|
|
488
|
+
}
|
|
489
|
+
)
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
# 👥 Group
|
|
495
|
+
|
|
496
|
+
Ambil metadata:
|
|
497
|
+
|
|
498
|
+
```javascript
|
|
499
|
+
const metadata =
|
|
500
|
+
await sock.groupMetadata(
|
|
501
|
+
"group@g.us"
|
|
502
|
+
)
|
|
503
|
+
|
|
504
|
+
console.log(
|
|
505
|
+
metadata.subject
|
|
506
|
+
)
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
Tambah member:
|
|
510
|
+
|
|
511
|
+
```javascript
|
|
512
|
+
await sock.groupParticipantsUpdate(
|
|
513
|
+
jid,
|
|
514
|
+
[
|
|
515
|
+
"user@s.whatsapp.net"
|
|
516
|
+
],
|
|
517
|
+
"add"
|
|
518
|
+
)
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
Promote:
|
|
522
|
+
|
|
523
|
+
```javascript
|
|
524
|
+
await sock.groupParticipantsUpdate(
|
|
525
|
+
jid,
|
|
526
|
+
[
|
|
527
|
+
"user@s.whatsapp.net"
|
|
528
|
+
],
|
|
529
|
+
"promote"
|
|
530
|
+
)
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
# 📢 Status WhatsApp
|
|
536
|
+
|
|
537
|
+
Kirim status:
|
|
538
|
+
|
|
539
|
+
```javascript
|
|
540
|
+
await sock.sendMessage(
|
|
541
|
+
"status@broadcast",
|
|
542
|
+
{
|
|
543
|
+
|
|
544
|
+
text:
|
|
545
|
+
"Hello from Vanzz"
|
|
546
|
+
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
)
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
|
|
554
|
+
# 🧩 Events
|
|
555
|
+
|
|
556
|
+
Pesan masuk:
|
|
557
|
+
|
|
558
|
+
```javascript
|
|
559
|
+
sock.ev.on(
|
|
560
|
+
"messages.upsert",
|
|
561
|
+
({messages})=>{
|
|
562
|
+
|
|
563
|
+
console.log(
|
|
564
|
+
messages[0]
|
|
565
|
+
)
|
|
566
|
+
|
|
567
|
+
})
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
Group update:
|
|
571
|
+
|
|
572
|
+
```javascript
|
|
573
|
+
sock.ev.on(
|
|
574
|
+
"group-participants.update",
|
|
575
|
+
console.log
|
|
576
|
+
)
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
---
|
|
580
|
+
|
|
581
|
+
# ⚙️ Production Tips
|
|
582
|
+
|
|
583
|
+
Gunakan:
|
|
584
|
+
|
|
585
|
+
✅ Group Metadata Cache
|
|
586
|
+
✅ Database Session
|
|
587
|
+
✅ Error Handler
|
|
588
|
+
✅ Auto Reconnect
|
|
589
|
+
✅ Rate Limit
|
|
590
|
+
|
|
591
|
+
Jangan gunakan spam automation karena dapat menyebabkan akun terkena pembatasan WhatsApp.
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
595
|
+
<div align="center">
|
|
596
|
+
|
|
597
|
+
# © Vanzz Baileys
|
|
598
|
+
|
|
599
|
+
Built for developers.
|
|
600
|
+
|
|
601
|
+
Fast • Modern • Lightweight
|
|
602
|
+
|
|
603
|
+
</div>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
yarn pbjs -t static-module -w commonjs -o ./WAProto/index.js ./WAProto/WAProto.proto;
|
|
2
|
+
yarn pbts -o ./WAProto/index.d.ts ./WAProto/index.js;
|
|
3
|
+
|
|
4
|
+
#protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=env=node,useOptionals=true,forceLong=long --ts_proto_out=. ./src/Binary/WAMessage.proto;
|