@vinzsocket/baileys 3.2.5 → 3.2.7
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 +221 -275
- package/lib/Socket/dugong.d.ts +18 -167
- package/lib/Socket/dugong.js +272 -532
- package/lib/Socket/messages-send.js +8 -0
- package/lib/Utils/messages.js +10 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,315 +4,315 @@
|
|
|
4
4
|
|
|
5
5
|
**A lightweight WebSocket library for WhatsApp Web Multi-Device**
|
|
6
6
|
|
|
7
|
-
[](https://github.com/VinzSocket/Baileys)
|
|
8
|
+

|
|
9
9
|

|
|
10
|
-

|
|
11
10
|
|
|
12
11
|
</div>
|
|
13
12
|
|
|
14
13
|
---
|
|
15
14
|
|
|
16
|
-
##
|
|
15
|
+
## 📦 Install
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
```bash
|
|
18
|
+
npm install @vinzsocket/baileys
|
|
19
|
+
```
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
---
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
## 🔔 Changelog v3.2.6
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
### ✅ Group Status V2 — Semua Media + Caption
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### 🔐 Authentication
|
|
29
|
-
- QR Code Login
|
|
30
|
-
- Pairing Code (tanpa scan QR)
|
|
31
|
-
- Multi-Device Support
|
|
32
|
-
- Session Management
|
|
33
|
-
- Auto Reconnect
|
|
34
|
-
|
|
35
|
-
### 💬 Messaging
|
|
36
|
-
- Text, Image, Video, Audio, Document, Sticker
|
|
37
|
-
- Reaction, Mention, Quoted Message
|
|
38
|
-
- View Once, Edit Message, Revoke Message
|
|
39
|
-
- Location, Contact, Poll
|
|
40
|
-
- **List Message** (flat & nested multi-section)
|
|
41
|
-
- **Interactive Message** — semua Native Flow V7 button shape
|
|
42
|
-
- Album, Event, Product, Request Payment
|
|
43
|
-
- Group Status V2 (group story)
|
|
44
|
-
|
|
45
|
-
### 👥 Group Management
|
|
46
|
-
- Create Group
|
|
47
|
-
- Update Subject, Description, PP
|
|
48
|
-
- Add/Remove Member
|
|
49
|
-
- Promote/Demote Admin
|
|
50
|
-
- Group Settings
|
|
51
|
-
|
|
52
|
-
### 🔒 Security
|
|
53
|
-
- End-to-End Encryption (Signal Protocol)
|
|
54
|
-
- Sender Key Distribution
|
|
55
|
-
|
|
56
|
-
### 🔄 Synchronization
|
|
57
|
-
- Chat, Contact, Group, Device & History Sync
|
|
58
|
-
- Presence (online, typing, etc.)
|
|
59
|
-
|
|
60
|
-
### 🛠️ Lainnya
|
|
61
|
-
- Media Upload/Download
|
|
62
|
-
- Link Preview
|
|
63
|
-
- Business API Support
|
|
64
|
-
- Full TypeScript Support
|
|
27
|
+
`handleGroupStory` sekarang support semua tipe media dengan caption:
|
|
65
28
|
|
|
66
|
-
|
|
29
|
+
| Tipe | Field | Caption |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| Teks | `text` | — |
|
|
32
|
+
| Foto | `image` | ✅ `caption` |
|
|
33
|
+
| Video | `video` | ✅ `caption` |
|
|
34
|
+
| Audio voice note | `audio` + `ptt: true` | — |
|
|
35
|
+
| Audio musik | `audio` + `ptt: false` | — |
|
|
36
|
+
| Sticker | `sticker` | — |
|
|
37
|
+
| Dokumen | `document` | ✅ `caption` |
|
|
67
38
|
|
|
68
|
-
|
|
39
|
+
### ✅ Multi-Select Message
|
|
69
40
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```
|
|
41
|
+
Satu pesan dengan beberapa tombol dropdown (`single_select`) sekaligus.
|
|
42
|
+
Tiap tombol buka bottom sheet sendiri dengan sections & rows berbeda.
|
|
73
43
|
|
|
74
|
-
|
|
44
|
+
### ✅ Nested List Message
|
|
75
45
|
|
|
76
|
-
|
|
46
|
+
Legacy `listMessage` dengan auto-flatten nested rows jadi sections terpisah.
|
|
77
47
|
|
|
78
|
-
|
|
79
|
-
- feat(dugong): tambah **nested list** (`nestedListMessage`) — list yang isinya ada list lagi
|
|
80
|
-
- feat(dugong): export semua **Native Flow V7 button builder** (`nfButtonUrl`, `nfButtonCall`, `nfButtonCopy`, `nfButtonReminder`, `nfButtonCancelReminder`, `nfButtonAddress`, `nfButtonLocation`, `nfButtonQuickReply`, `nfButtonSingleSelect`, `nfButtonReviewPay`, `nfButtonReviewOrder`, `nfButtonMPM`)
|
|
81
|
-
- feat(messages-send): wire `NESTED_LIST` case ke `sendMessage()` dengan proper `additionalNodes`
|
|
48
|
+
### ✅ NF V7 Button Builders
|
|
82
49
|
|
|
83
|
-
|
|
50
|
+
Export semua 12 native flow button builder dari `dugong.js`.
|
|
51
|
+
|
|
52
|
+
### ✅ buildInteractiveAdditionalNodes
|
|
84
53
|
|
|
85
|
-
|
|
54
|
+
Tambah handler `groupStatusMessageV2` — inject `<meta is_vsn2="1">` di grup.
|
|
55
|
+
|
|
56
|
+
---
|
|
86
57
|
|
|
87
|
-
|
|
58
|
+
## 👥 Group Status V2
|
|
88
59
|
|
|
89
|
-
###
|
|
60
|
+
### Teks
|
|
90
61
|
|
|
91
62
|
```js
|
|
92
|
-
await conn.sendMessage(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
description: 'Footer pesan',
|
|
96
|
-
buttonText: '📋 Buka Menu',
|
|
97
|
-
listType: 1,
|
|
98
|
-
sections: [
|
|
99
|
-
{
|
|
100
|
-
title: '🎮 Kategori',
|
|
101
|
-
rows: [
|
|
102
|
-
{ rowId: 'rpg_shop', title: '🏪 Shop', description: 'Beli item' },
|
|
103
|
-
{ rowId: 'rpg_inv', title: '🎒 Inventory', description: 'Lihat inventory' }
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
]
|
|
63
|
+
await conn.sendMessage(groupJid, {
|
|
64
|
+
groupStatusMessage: {
|
|
65
|
+
text: '📢 Pengumuman penting dari admin!'
|
|
107
66
|
}
|
|
108
67
|
})
|
|
109
68
|
```
|
|
110
69
|
|
|
111
|
-
|
|
70
|
+
### Teks dengan Background Color
|
|
112
71
|
|
|
113
|
-
|
|
72
|
+
```js
|
|
73
|
+
await conn.sendMessage(groupJid, {
|
|
74
|
+
groupStatusMessage: {
|
|
75
|
+
text: 'Status dengan background merah',
|
|
76
|
+
backgroundColor: 0xFFE53935, // ARGB
|
|
77
|
+
textArgb: 0xFFFFFFFF,
|
|
78
|
+
font: 1 // 0-5
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
```
|
|
114
82
|
|
|
115
|
-
|
|
83
|
+
### Foto dengan Caption
|
|
116
84
|
|
|
117
85
|
```js
|
|
118
|
-
await conn.sendMessage(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
footer: 'Harps-MD Shop',
|
|
123
|
-
sections: [
|
|
124
|
-
{
|
|
125
|
-
title: '⚔️ Senjata',
|
|
126
|
-
rows: [
|
|
127
|
-
// flat row biasa
|
|
128
|
-
{ rowId: 'wpn_sword', title: '🗡️ Pedang', description: '50 ATK' },
|
|
129
|
-
// nested row → dijadikan section baru
|
|
130
|
-
{
|
|
131
|
-
title: '🏹 Senjata Jarak Jauh',
|
|
132
|
-
rows: [
|
|
133
|
-
{ rowId: 'wpn_bow', title: '🏹 Busur', description: '35 ATK' },
|
|
134
|
-
{ rowId: 'wpn_crossbow', title: '🔫 Crossbow', description: '45 ATK' }
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
title: '🛡️ Armor',
|
|
141
|
-
rows: [
|
|
142
|
-
{ rowId: 'arm_light', title: '👕 Light Armor', description: '20 DEF' },
|
|
143
|
-
{ rowId: 'arm_heavy', title: '🛡️ Heavy Armor', description: '50 DEF' }
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
]
|
|
86
|
+
await conn.sendMessage(groupJid, {
|
|
87
|
+
groupStatusMessage: {
|
|
88
|
+
image: { url: 'https://example.com/photo.jpg' },
|
|
89
|
+
caption: '📸 Foto kegiatan hari ini!'
|
|
147
90
|
}
|
|
148
91
|
})
|
|
149
|
-
```
|
|
150
92
|
|
|
151
|
-
|
|
93
|
+
// Atau pakai Buffer
|
|
94
|
+
await conn.sendMessage(groupJid, {
|
|
95
|
+
groupStatusMessage: {
|
|
96
|
+
image: fs.readFileSync('./photo.jpg'),
|
|
97
|
+
caption: 'Caption foto'
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
```
|
|
152
101
|
|
|
153
|
-
|
|
102
|
+
### Video dengan Caption
|
|
154
103
|
|
|
155
|
-
|
|
104
|
+
```js
|
|
105
|
+
await conn.sendMessage(groupJid, {
|
|
106
|
+
groupStatusMessage: {
|
|
107
|
+
video: { url: 'https://example.com/video.mp4' },
|
|
108
|
+
caption: '🎬 Video kegiatan',
|
|
109
|
+
seconds: 30 // opsional, durasi
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
```
|
|
156
113
|
|
|
157
|
-
|
|
114
|
+
### GIF
|
|
158
115
|
|
|
159
116
|
```js
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
nfButtonAddress,
|
|
167
|
-
nfButtonLocation,
|
|
168
|
-
nfButtonQuickReply,
|
|
169
|
-
nfButtonSingleSelect,
|
|
170
|
-
nfButtonReviewPay,
|
|
171
|
-
nfButtonReviewOrder,
|
|
172
|
-
nfButtonMPM
|
|
173
|
-
} from '@vinzsocket/baileys/lib/Socket/dugong.js'
|
|
117
|
+
await conn.sendMessage(groupJid, {
|
|
118
|
+
groupStatusMessage: {
|
|
119
|
+
video: { url: 'https://example.com/anim.mp4' },
|
|
120
|
+
gifPlayback: true
|
|
121
|
+
}
|
|
122
|
+
})
|
|
174
123
|
```
|
|
175
124
|
|
|
176
|
-
###
|
|
125
|
+
### Audio Voice Note
|
|
177
126
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
| `nfButtonQuickReply` | `quick_reply` | Balas cepat dengan payload |
|
|
188
|
-
| `nfButtonSingleSelect` | `single_select` | Dropdown / bottom sheet pilihan |
|
|
189
|
-
| `nfButtonReviewPay` | `review_and_pay` | Review & bayar order |
|
|
190
|
-
| `nfButtonReviewOrder` | `review_order` | Review order saja |
|
|
191
|
-
| `nfButtonMPM` | `mpm` | Tampilkan katalog produk |
|
|
127
|
+
```js
|
|
128
|
+
await conn.sendMessage(groupJid, {
|
|
129
|
+
groupStatusMessage: {
|
|
130
|
+
audio: { url: 'https://example.com/voice.ogg' },
|
|
131
|
+
ptt: true, // voice note
|
|
132
|
+
seconds: 15 // durasi opsional
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
```
|
|
192
136
|
|
|
193
|
-
|
|
137
|
+
### Audio Musik
|
|
194
138
|
|
|
195
|
-
|
|
139
|
+
```js
|
|
140
|
+
await conn.sendMessage(groupJid, {
|
|
141
|
+
groupStatusMessage: {
|
|
142
|
+
audio: { url: 'https://example.com/music.mp3' },
|
|
143
|
+
ptt: false, // bukan voice note
|
|
144
|
+
mimetype: 'audio/mp4' // atau 'audio/mpeg'
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Sticker
|
|
196
150
|
|
|
197
151
|
```js
|
|
198
|
-
|
|
152
|
+
await conn.sendMessage(groupJid, {
|
|
153
|
+
groupStatusMessage: {
|
|
154
|
+
sticker: { url: 'https://example.com/sticker.webp' }
|
|
155
|
+
}
|
|
156
|
+
})
|
|
157
|
+
```
|
|
199
158
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
nfButtonCopy({
|
|
210
|
-
displayText: '📋 Salin Kode',
|
|
211
|
-
copyCode: 'ABC123'
|
|
212
|
-
}),
|
|
213
|
-
nfButtonQuickReply({
|
|
214
|
-
id: 'confirm_yes',
|
|
215
|
-
displayText: '✅ Konfirmasi'
|
|
216
|
-
})
|
|
217
|
-
]
|
|
159
|
+
### Dokumen dengan Caption
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
await conn.sendMessage(groupJid, {
|
|
163
|
+
groupStatusMessage: {
|
|
164
|
+
document: { url: 'https://example.com/file.pdf' },
|
|
165
|
+
mimetype: 'application/pdf',
|
|
166
|
+
fileName: 'Laporan.pdf',
|
|
167
|
+
caption: '📄 Laporan bulan ini'
|
|
218
168
|
}
|
|
219
169
|
})
|
|
220
170
|
```
|
|
221
171
|
|
|
222
172
|
---
|
|
223
173
|
|
|
224
|
-
|
|
174
|
+
## ⚡ Multi-Select Message
|
|
225
175
|
|
|
226
|
-
|
|
227
|
-
import { nfButtonSingleSelect } from '@vinzsocket/baileys/lib/Socket/dugong.js'
|
|
176
|
+
Satu pesan, beberapa tombol dropdown. Tiap tombol buka bottom sheet sendiri.
|
|
228
177
|
|
|
178
|
+
```js
|
|
229
179
|
await conn.sendMessage(jid, {
|
|
230
|
-
|
|
231
|
-
title: '⚙️
|
|
232
|
-
footer: '
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
displayText: '
|
|
180
|
+
multiSelectMessage: {
|
|
181
|
+
title: '⚙️ Konfigurasi Karakter',
|
|
182
|
+
footer: 'Pilih semua opsi',
|
|
183
|
+
selectors: [
|
|
184
|
+
{
|
|
185
|
+
displayText: '⚔️ Pilih Senjata',
|
|
236
186
|
sections: [
|
|
237
187
|
{
|
|
238
|
-
title: '
|
|
188
|
+
title: '🗡️ Melee',
|
|
239
189
|
rows: [
|
|
240
|
-
{ id: '
|
|
241
|
-
{ id: '
|
|
190
|
+
{ id: 'sword', title: '⚔️ Iron Sword', description: '40 ATK' },
|
|
191
|
+
{ id: 'axe', title: '🪓 Battle Axe', description: '60 ATK' }
|
|
242
192
|
]
|
|
243
193
|
},
|
|
244
194
|
{
|
|
245
|
-
title: '
|
|
195
|
+
title: '🏹 Ranged',
|
|
246
196
|
rows: [
|
|
247
|
-
{ id: '
|
|
248
|
-
{ id: '
|
|
197
|
+
{ id: 'bow', title: '🏹 Busur', description: '30 ATK' },
|
|
198
|
+
{ id: 'xbow', title: '🔫 Crossbow', description: '55 ATK' }
|
|
249
199
|
]
|
|
250
200
|
}
|
|
251
201
|
]
|
|
252
|
-
}
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
displayText: '🛡️ Pilih Armor',
|
|
205
|
+
sections: [
|
|
206
|
+
{
|
|
207
|
+
title: '🧥 Light',
|
|
208
|
+
rows: [
|
|
209
|
+
{ id: 'cloth', title: '👕 Cloth', description: '10 DEF' },
|
|
210
|
+
{ id: 'leather', title: '🥼 Leather', description: '25 DEF' }
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
// Tombol tambahan opsional
|
|
217
|
+
extraButtons: [
|
|
218
|
+
{ name: 'quick_reply', buttonParamsJson: JSON.stringify({ display_text: '✅ Konfirmasi', id: 'confirm' }) }
|
|
253
219
|
]
|
|
254
220
|
}
|
|
255
|
-
})
|
|
221
|
+
}, { quoted: msg })
|
|
256
222
|
```
|
|
257
223
|
|
|
258
224
|
---
|
|
259
225
|
|
|
260
|
-
|
|
226
|
+
## 📝 Nested List Message
|
|
227
|
+
|
|
228
|
+
Legacy `listMessage` dengan nested sections otomatis.
|
|
261
229
|
|
|
262
230
|
```js
|
|
263
231
|
await conn.sendMessage(jid, {
|
|
264
|
-
|
|
265
|
-
title: '
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
232
|
+
nestedListMessage: {
|
|
233
|
+
title: '🛒 Harps Shop',
|
|
234
|
+
buttonText: '📋 Buka Katalog',
|
|
235
|
+
footer: 'Pilih item',
|
|
236
|
+
sections: [
|
|
237
|
+
{
|
|
238
|
+
title: '⚔️ Senjata',
|
|
239
|
+
rows: [
|
|
240
|
+
// Flat row biasa
|
|
241
|
+
{ rowId: 'dagger', title: '🗡️ Dagger', description: '25 ATK' },
|
|
242
|
+
// Nested row → otomatis jadi section baru "🏹 Jarak Jauh"
|
|
243
|
+
{
|
|
244
|
+
title: '🏹 Jarak Jauh',
|
|
245
|
+
rows: [
|
|
246
|
+
{ rowId: 'bow', title: '🏹 Busur', description: '30 ATK' },
|
|
247
|
+
{ rowId: 'xbow', title: '🔫 Crossbow', description: '55 ATK' }
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
}
|
|
272
252
|
]
|
|
273
253
|
}
|
|
274
|
-
})
|
|
254
|
+
}, { quoted: msg })
|
|
275
255
|
```
|
|
276
256
|
|
|
277
257
|
---
|
|
278
258
|
|
|
279
|
-
##
|
|
280
|
-
|
|
281
|
-
Kalau mau build raw proto payload tanpa `sendMessage`:
|
|
259
|
+
## ⚡ NF V7 Button Builders
|
|
282
260
|
|
|
283
261
|
```js
|
|
284
|
-
import {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
|
|
262
|
+
import {
|
|
263
|
+
nfButtonUrl, nfButtonCall, nfButtonCopy,
|
|
264
|
+
nfButtonReminder, nfButtonCancelReminder,
|
|
265
|
+
nfButtonAddress, nfButtonLocation,
|
|
266
|
+
nfButtonQuickReply, nfButtonSingleSelect,
|
|
267
|
+
nfButtonMultiSelect,
|
|
268
|
+
nfButtonReviewPay, nfButtonReviewOrder, nfButtonMPM
|
|
269
|
+
} from '@vinzsocket/baileys/lib/Socket/dugong.js'
|
|
270
|
+
|
|
271
|
+
await conn.sendMessage(jid, {
|
|
272
|
+
interactiveMessage: {
|
|
273
|
+
title: '🎛️ Mixed Buttons',
|
|
274
|
+
footer: 'Harps-MD',
|
|
275
|
+
buttons: [
|
|
276
|
+
nfButtonQuickReply({ id: 'ok', displayText: '✅ OK' }),
|
|
277
|
+
nfButtonUrl({ displayText: '🌐 Website', url: 'https://example.com' }),
|
|
278
|
+
nfButtonCopy({ displayText: '📋 Salin', copyCode: 'KODE123' }),
|
|
279
|
+
nfButtonSingleSelect({
|
|
280
|
+
displayText: '📋 Pilih',
|
|
281
|
+
sections: [
|
|
282
|
+
{ title: 'Opsi', rows: [
|
|
283
|
+
{ id: 'a', title: 'Opsi A' },
|
|
284
|
+
{ id: 'b', title: 'Opsi B' }
|
|
285
|
+
]}
|
|
286
|
+
]
|
|
287
|
+
})
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
}, { quoted: msg })
|
|
307
291
|
```
|
|
308
292
|
|
|
293
|
+
| Builder | Nama Proto | Fungsi |
|
|
294
|
+
|---|---|---|
|
|
295
|
+
| `nfButtonUrl` | `cta_url` | Buka URL |
|
|
296
|
+
| `nfButtonCall` | `cta_call` | Telepon |
|
|
297
|
+
| `nfButtonCopy` | `cta_copy` | Salin kode |
|
|
298
|
+
| `nfButtonReminder` | `cta_reminder` | Set reminder |
|
|
299
|
+
| `nfButtonCancelReminder` | `cta_cancel_reminder` | Batalkan reminder |
|
|
300
|
+
| `nfButtonAddress` | `address_message` | Isi & kirim alamat |
|
|
301
|
+
| `nfButtonLocation` | `send_location` | Kirim GPS |
|
|
302
|
+
| `nfButtonQuickReply` | `quick_reply` | Balas cepat |
|
|
303
|
+
| `nfButtonSingleSelect` | `single_select` | 1 dropdown |
|
|
304
|
+
| `nfButtonMultiSelect` | `single_select` ×N | Beberapa dropdown |
|
|
305
|
+
| `nfButtonReviewPay` | `review_and_pay` | Payment flow |
|
|
306
|
+
| `nfButtonReviewOrder` | `review_order` | Review order |
|
|
307
|
+
| `nfButtonMPM` | `mpm` | Multi-product |
|
|
308
|
+
|
|
309
309
|
---
|
|
310
310
|
|
|
311
|
-
## ⚠️
|
|
311
|
+
## ⚠️ additionalNodes
|
|
312
312
|
|
|
313
|
-
|
|
313
|
+
Semua interactive/list message butuh binary node hint. Harps-Baileys inject otomatis — tidak perlu relay manual.
|
|
314
314
|
|
|
315
|
-
Kalau
|
|
315
|
+
Kalau perlu relay manual:
|
|
316
316
|
|
|
317
317
|
```js
|
|
318
318
|
import { buildInteractiveAdditionalNodes } from '@vinzsocket/baileys/lib/Utils/messages.js'
|
|
@@ -323,62 +323,8 @@ await relayMessage(jid, msg.message, {
|
|
|
323
323
|
})
|
|
324
324
|
```
|
|
325
325
|
|
|
326
|
-
Node yang di-inject:
|
|
327
|
-
- **List message** → `<biz><list type="product_list" v="2"/></biz>`
|
|
328
|
-
- **Interactive/button/template/product** → `<biz><interactive type="native_flow" v="1"><native_flow name="mixed" v="9"/></interactive></biz>`
|
|
329
|
-
- **1:1 chat (bukan grup)** → tambahan `<bot biz_bot="1"/>`
|
|
330
|
-
|
|
331
|
-
---
|
|
332
|
-
|
|
333
|
-
## 🔌 Quick Start
|
|
334
|
-
|
|
335
|
-
```js
|
|
336
|
-
import makeWASocket, { useMultiFileAuthState } from '@vinzsocket/baileys'
|
|
337
|
-
|
|
338
|
-
const { state, saveCreds } = await useMultiFileAuthState('./auth')
|
|
339
|
-
|
|
340
|
-
const conn = makeWASocket({
|
|
341
|
-
auth: state,
|
|
342
|
-
printQRInTerminal: true
|
|
343
|
-
})
|
|
344
|
-
|
|
345
|
-
conn.ev.on('creds.update', saveCreds)
|
|
346
|
-
|
|
347
|
-
conn.ev.on('messages.upsert', async ({ messages }) => {
|
|
348
|
-
const msg = messages[0]
|
|
349
|
-
if (!msg.message) return
|
|
350
|
-
const text = msg.message.conversation || msg.message.extendedTextMessage?.text || ''
|
|
351
|
-
const from = msg.key.remoteJid
|
|
352
|
-
|
|
353
|
-
if (text === '!menu') {
|
|
354
|
-
await conn.sendMessage(from, {
|
|
355
|
-
nestedListMessage: {
|
|
356
|
-
title: '📋 Main Menu',
|
|
357
|
-
buttonText: 'Buka Menu',
|
|
358
|
-
footer: 'Harps-MD Bot',
|
|
359
|
-
sections: [
|
|
360
|
-
{
|
|
361
|
-
title: '🎮 Game',
|
|
362
|
-
rows: [
|
|
363
|
-
{ rowId: 'rpg', title: '⚔️ RPG', description: 'Main RPG' },
|
|
364
|
-
{
|
|
365
|
-
title: '🏆 Kompetitif',
|
|
366
|
-
rows: [
|
|
367
|
-
{ rowId: 'pvp', title: '⚔️ PvP' },
|
|
368
|
-
{ rowId: 'rank', title: '📊 Ranking' }
|
|
369
|
-
]
|
|
370
|
-
}
|
|
371
|
-
]
|
|
372
|
-
}
|
|
373
|
-
]
|
|
374
|
-
}
|
|
375
|
-
}, { quoted: msg })
|
|
376
|
-
}
|
|
377
|
-
})
|
|
378
|
-
```
|
|
379
|
-
|
|
380
326
|
---
|
|
381
327
|
|
|
382
328
|
## 📄 License
|
|
383
329
|
|
|
384
|
-
MIT — ©
|
|
330
|
+
MIT — © VinzSocket
|