@nuiisweety/baileys 0.1.16 → 0.1.17
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 +390 -833
- package/README.md.bak +1 -1
- package/lib/Socket/index.js +14 -22
- package/lib/Socket/index.js.bak +4 -4
- package/lib/Socket/messages-send.js +1 -0
- package/lib/Socket/messages-send.js.bak +5 -2
- package/lib/Utils/messages.js +13 -0
- package/lib/Utils/messages.js.bak +921 -309
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,120 +2,138 @@
|
|
|
2
2
|
|
|
3
3
|
<img src="https://raw.githubusercontent.com/NuiiS4TORU/-nuisockets/refs/heads/main/nuiisweety.png" width="100%"/>
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<br/>
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
*dikembangkan dengan sepenuh hati oleh **NuiiS4TORU***
|
|
7
|
+
# `@nuiisweety/baileys`
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
<p>Fork dari <a href="https://github.com/WhiskeySockets/Baileys"><b>@whiskeysockets/baileys</b></a> v7.0.0-rc11 · dikembangkan dengan sepenuh hati oleh <b>NuiiS4TORU</b></p>
|
|
10
|
+
|
|
11
|
+
<p>
|
|
12
|
+
<img src="https://img.shields.io/badge/versi-0.1.17-ff69b4?style=for-the-badge&logo=npm&logoColor=white" alt="version"/>
|
|
13
|
+
<img src="https://img.shields.io/badge/lisensi-MIT-c084fc?style=for-the-badge" alt="license"/>
|
|
14
|
+
<img src="https://img.shields.io/badge/platform-Node.js-22c55e?style=for-the-badge&logo=nodedotjs&logoColor=white" alt="platform"/>
|
|
15
|
+
<img src="https://img.shields.io/badge/WhatsApp-API-25d366?style=for-the-badge&logo=whatsapp&logoColor=white" alt="whatsapp"/>
|
|
16
|
+
</p>
|
|
13
17
|
|
|
14
18
|
</div>
|
|
15
19
|
|
|
16
20
|
---
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
[
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
[
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[Group
|
|
62
|
-
[
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
[
|
|
76
|
-
[
|
|
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
|
-
[
|
|
109
|
-
[
|
|
110
|
-
[
|
|
111
|
-
[
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
22
|
+
## 📋 Daftar Isi
|
|
23
|
+
|
|
24
|
+
<table>
|
|
25
|
+
<tr>
|
|
26
|
+
<td valign="top" width="25%">
|
|
27
|
+
|
|
28
|
+
**🔌 Koneksi & Setup**
|
|
29
|
+
- [Instalasi](#-instalasi)
|
|
30
|
+
- [QR Code](#-koneksi-qr-code)
|
|
31
|
+
- [Pairing Code](#-koneksi-pairing-code)
|
|
32
|
+
- [Browser Identity](#-browser-identity)
|
|
33
|
+
- [Opsi Koneksi](#%EF%B8%8F-opsi-koneksi)
|
|
34
|
+
|
|
35
|
+
**📨 Handle Pesan**
|
|
36
|
+
- [Terima Pesan](#-terima-pesan)
|
|
37
|
+
- [Handle Grup](#-handle-grup)
|
|
38
|
+
|
|
39
|
+
**📤 Kirim Pesan**
|
|
40
|
+
- [Teks](#-teks)
|
|
41
|
+
- [Gambar](#%EF%B8%8F-gambar)
|
|
42
|
+
- [Video](#-video)
|
|
43
|
+
- [Audio & Voice Note](#%EF%B8%8F-audio--voice-note)
|
|
44
|
+
- [Dokumen](#-dokumen)
|
|
45
|
+
- [Sticker](#-sticker)
|
|
46
|
+
- [Lokasi](#-lokasi)
|
|
47
|
+
- [Kontak](#-kontak)
|
|
48
|
+
|
|
49
|
+
</td>
|
|
50
|
+
<td valign="top" width="25%">
|
|
51
|
+
|
|
52
|
+
**💬 Interaksi**
|
|
53
|
+
- [Reaksi](#-reaksi)
|
|
54
|
+
- [Poll](#-poll)
|
|
55
|
+
- [Poll Result](#-poll-result)
|
|
56
|
+
- [Poll Update](#-poll-update)
|
|
57
|
+
- [Forward](#%EF%B8%8F-forward)
|
|
58
|
+
- [Hapus Pesan](#%EF%B8%8F-hapus-pesan)
|
|
59
|
+
- [Edit Pesan](#%EF%B8%8F-edit-pesan)
|
|
60
|
+
- [Pin Pesan](#-pin-pesan)
|
|
61
|
+
|
|
62
|
+
**✨ Fitur Tambahan**
|
|
63
|
+
- [Album](#%EF%B8%8F-album)
|
|
64
|
+
- [Event](#-event)
|
|
65
|
+
- [Group Status / Story](#-group-status--group-story)
|
|
66
|
+
- [Status Mention](#%EF%B8%8F-status-mention)
|
|
67
|
+
- [Channel (Newsletter)](#-channel-newsletter)
|
|
68
|
+
- [Flow Reply](#-flow-reply)
|
|
69
|
+
- [Button Reply](#-button-reply)
|
|
70
|
+
- [Keep In Chat](#-keep-in-chat)
|
|
71
|
+
- [Scheduled Call](#-scheduled-call)
|
|
72
|
+
- [Group Invite](#-group-invite)
|
|
73
|
+
- [Product](#%EF%B8%8F-product)
|
|
74
|
+
|
|
75
|
+
</td>
|
|
76
|
+
<td valign="top" width="25%">
|
|
77
|
+
|
|
78
|
+
**🎁 Wrapper**
|
|
79
|
+
- [View Once](#%EF%B8%8F-view-once)
|
|
80
|
+
- [View Once V2](#%EF%B8%8F-view-once-v2)
|
|
81
|
+
- [Ephemeral](#-ephemeral)
|
|
82
|
+
- [Spoiler](#-spoiler)
|
|
83
|
+
- [Group Status Wrap](#-group-status-wrap)
|
|
84
|
+
- [Lottie Sticker](#%EF%B8%8F-lottie-sticker)
|
|
85
|
+
- [AI Icon](#-ai-icon)
|
|
86
|
+
- [Secure Meta Label](#-secure-meta-service-label)
|
|
87
|
+
|
|
88
|
+
**🎛️ Interactive**
|
|
89
|
+
- [Buttons Location Header](#-buttons-dengan-location-header)
|
|
90
|
+
- [Buttons](#%EF%B8%8F-buttons)
|
|
91
|
+
- [List Message](#-list-message)
|
|
92
|
+
- [Template Buttons](#%EF%B8%8F-template-buttons)
|
|
93
|
+
- [Native Flow](#-native-flow)
|
|
94
|
+
- [Carousel](#-carousel)
|
|
95
|
+
|
|
96
|
+
**🔧 Lainnya**
|
|
97
|
+
- [List Reply](#-list-reply)
|
|
98
|
+
- [Sticker Pack](#-sticker-pack)
|
|
99
|
+
- [External Ad Reply](#-external-ad-reply)
|
|
100
|
+
- [Request Payment](#-request-payment)
|
|
101
|
+
- [Invoice](#-invoice)
|
|
102
|
+
- [Order](#-order)
|
|
103
|
+
- [Disappearing Messages](#-disappearing-messages)
|
|
104
|
+
- [Raw Message](#-raw-message)
|
|
105
|
+
|
|
106
|
+
</td>
|
|
107
|
+
<td valign="top" width="25%">
|
|
108
|
+
|
|
109
|
+
**🤖 Rich Message (AI)**
|
|
110
|
+
- [addText](#-addtext)
|
|
111
|
+
- [addCode](#-addcode)
|
|
112
|
+
- [addTable](#-addtable)
|
|
113
|
+
- [addImage](#%EF%B8%8F-addimage)
|
|
114
|
+
- [addVideo](#-addvideo)
|
|
115
|
+
- [addSource](#-addsource)
|
|
116
|
+
- [addReels](#-addreels)
|
|
117
|
+
- [addProduct](#%EF%B8%8F-addproduct)
|
|
118
|
+
- [addPost](#-addpost)
|
|
119
|
+
- [addTip](#-addtip)
|
|
120
|
+
- [addSuggest](#-addsuggest)
|
|
121
|
+
- [Map](#%EF%B8%8F-map-rich)
|
|
122
|
+
- [LaTeX](#-latex-rich)
|
|
123
|
+
- [Grid Image](#%EF%B8%8F-grid-image-rich)
|
|
124
|
+
- [Inline Image](#-inline-image-rich)
|
|
125
|
+
- [Dynamic/GIF](#%EF%B8%8F-dynamic--gif-rich)
|
|
126
|
+
- [Content Items](#-content-items-rich)
|
|
127
|
+
- [Rich Response](#-rich-response-gabungan)
|
|
128
|
+
- [Terima & Decode](#-terima--decode-rich-message)
|
|
129
|
+
|
|
130
|
+
</td>
|
|
131
|
+
</tr>
|
|
132
|
+
</table>
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 📦 Instalasi
|
|
119
137
|
|
|
120
138
|
```js
|
|
121
139
|
// CommonJS
|
|
@@ -125,12 +143,9 @@ const { default: makeWASocket } = require('@nuiisweety/baileys')
|
|
|
125
143
|
import makeWASocket from '@nuiisweety/baileys'
|
|
126
144
|
```
|
|
127
145
|
|
|
128
|
-
</details>
|
|
129
|
-
|
|
130
146
|
---
|
|
131
147
|
|
|
132
|
-
|
|
133
|
-
<summary>📱 Koneksi QR Code</summary>
|
|
148
|
+
## 📱 Koneksi QR Code
|
|
134
149
|
|
|
135
150
|
```js
|
|
136
151
|
const {
|
|
@@ -163,12 +178,9 @@ async function start() {
|
|
|
163
178
|
start()
|
|
164
179
|
```
|
|
165
180
|
|
|
166
|
-
</details>
|
|
167
|
-
|
|
168
181
|
---
|
|
169
182
|
|
|
170
|
-
|
|
171
|
-
<summary>🔑 Koneksi Pairing Code</summary>
|
|
183
|
+
## 🔑 Koneksi Pairing Code
|
|
172
184
|
|
|
173
185
|
> Cocok untuk server/VPS tanpa tampilan terminal.
|
|
174
186
|
|
|
@@ -192,12 +204,9 @@ if (!sock.authState.creds.registered) {
|
|
|
192
204
|
const code = await sock.requestPairingCode('628123456789', 'NUYY2822')
|
|
193
205
|
```
|
|
194
206
|
|
|
195
|
-
</details>
|
|
196
|
-
|
|
197
207
|
---
|
|
198
208
|
|
|
199
|
-
|
|
200
|
-
<summary>🌐 Browser Identity</summary>
|
|
209
|
+
## 🌐 Browser Identity
|
|
201
210
|
|
|
202
211
|
```js
|
|
203
212
|
const { Browsers } = require('@nuiisweety/baileys')
|
|
@@ -212,12 +221,9 @@ makeWASocket({
|
|
|
212
221
|
})
|
|
213
222
|
```
|
|
214
223
|
|
|
215
|
-
</details>
|
|
216
|
-
|
|
217
224
|
---
|
|
218
225
|
|
|
219
|
-
|
|
220
|
-
<summary>⚙️ Opsi Koneksi</summary>
|
|
226
|
+
## ⚙️ Opsi Koneksi
|
|
221
227
|
|
|
222
228
|
```js
|
|
223
229
|
makeWASocket({
|
|
@@ -235,12 +241,9 @@ makeWASocket({
|
|
|
235
241
|
})
|
|
236
242
|
```
|
|
237
243
|
|
|
238
|
-
</details>
|
|
239
|
-
|
|
240
244
|
---
|
|
241
245
|
|
|
242
|
-
|
|
243
|
-
<summary>📬 Terima Pesan</summary>
|
|
246
|
+
## 📬 Terima Pesan
|
|
244
247
|
|
|
245
248
|
```js
|
|
246
249
|
sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
@@ -266,12 +269,9 @@ sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
|
266
269
|
})
|
|
267
270
|
```
|
|
268
271
|
|
|
269
|
-
</details>
|
|
270
|
-
|
|
271
272
|
---
|
|
272
273
|
|
|
273
|
-
|
|
274
|
-
<summary>👥 Handle Grup</summary>
|
|
274
|
+
## 👥 Handle Grup
|
|
275
275
|
|
|
276
276
|
```js
|
|
277
277
|
// Anggota masuk/keluar
|
|
@@ -312,12 +312,9 @@ await sock.sendMessage(groupJid, {
|
|
|
312
312
|
})
|
|
313
313
|
```
|
|
314
314
|
|
|
315
|
-
</details>
|
|
316
|
-
|
|
317
315
|
---
|
|
318
316
|
|
|
319
|
-
|
|
320
|
-
<summary>💬 Teks</summary>
|
|
317
|
+
## 💬 Teks
|
|
321
318
|
|
|
322
319
|
```js
|
|
323
320
|
await sock.sendMessage(jid, { text: 'Halo!' })
|
|
@@ -329,12 +326,9 @@ await sock.sendMessage(jid, {
|
|
|
329
326
|
}, { quoted: m })
|
|
330
327
|
```
|
|
331
328
|
|
|
332
|
-
</details>
|
|
333
|
-
|
|
334
329
|
---
|
|
335
330
|
|
|
336
|
-
|
|
337
|
-
<summary>🖼️ Gambar</summary>
|
|
331
|
+
## 🖼️ Gambar
|
|
338
332
|
|
|
339
333
|
```js
|
|
340
334
|
// URL
|
|
@@ -350,12 +344,9 @@ await sock.sendMessage(jid, {
|
|
|
350
344
|
})
|
|
351
345
|
```
|
|
352
346
|
|
|
353
|
-
</details>
|
|
354
|
-
|
|
355
347
|
---
|
|
356
348
|
|
|
357
|
-
|
|
358
|
-
<summary>🎬 Video</summary>
|
|
349
|
+
## 🎬 Video
|
|
359
350
|
|
|
360
351
|
```js
|
|
361
352
|
await sock.sendMessage(jid, {
|
|
@@ -371,12 +362,9 @@ await sock.sendMessage(jid, {
|
|
|
371
362
|
})
|
|
372
363
|
```
|
|
373
364
|
|
|
374
|
-
</details>
|
|
375
|
-
|
|
376
365
|
---
|
|
377
366
|
|
|
378
|
-
|
|
379
|
-
<summary>🎙️ Audio & Voice Note</summary>
|
|
367
|
+
## 🎙️ Audio & Voice Note
|
|
380
368
|
|
|
381
369
|
```js
|
|
382
370
|
// Audio biasa
|
|
@@ -393,12 +381,9 @@ await sock.sendMessage(jid, {
|
|
|
393
381
|
})
|
|
394
382
|
```
|
|
395
383
|
|
|
396
|
-
</details>
|
|
397
|
-
|
|
398
384
|
---
|
|
399
385
|
|
|
400
|
-
|
|
401
|
-
<summary>📄 Dokumen</summary>
|
|
386
|
+
## 📄 Dokumen
|
|
402
387
|
|
|
403
388
|
```js
|
|
404
389
|
await sock.sendMessage(jid, {
|
|
@@ -409,23 +394,17 @@ await sock.sendMessage(jid, {
|
|
|
409
394
|
})
|
|
410
395
|
```
|
|
411
396
|
|
|
412
|
-
</details>
|
|
413
|
-
|
|
414
397
|
---
|
|
415
398
|
|
|
416
|
-
|
|
417
|
-
<summary>🎴 Sticker</summary>
|
|
399
|
+
## 🎴 Sticker
|
|
418
400
|
|
|
419
401
|
```js
|
|
420
402
|
await sock.sendMessage(jid, { sticker: fs.readFileSync('sticker.webp') })
|
|
421
403
|
```
|
|
422
404
|
|
|
423
|
-
</details>
|
|
424
|
-
|
|
425
405
|
---
|
|
426
406
|
|
|
427
|
-
|
|
428
|
-
<summary>📍 Lokasi</summary>
|
|
407
|
+
## 📍 Lokasi
|
|
429
408
|
|
|
430
409
|
```js
|
|
431
410
|
await sock.sendMessage(jid, {
|
|
@@ -438,12 +417,9 @@ await sock.sendMessage(jid, {
|
|
|
438
417
|
})
|
|
439
418
|
```
|
|
440
419
|
|
|
441
|
-
</details>
|
|
442
|
-
|
|
443
420
|
---
|
|
444
421
|
|
|
445
|
-
|
|
446
|
-
<summary>👤 Kontak</summary>
|
|
422
|
+
## 👤 Kontak
|
|
447
423
|
|
|
448
424
|
```js
|
|
449
425
|
await sock.sendMessage(jid, {
|
|
@@ -456,12 +432,9 @@ await sock.sendMessage(jid, {
|
|
|
456
432
|
})
|
|
457
433
|
```
|
|
458
434
|
|
|
459
|
-
</details>
|
|
460
|
-
|
|
461
435
|
---
|
|
462
436
|
|
|
463
|
-
|
|
464
|
-
<summary>❤️ Reaksi</summary>
|
|
437
|
+
## ❤️ Reaksi
|
|
465
438
|
|
|
466
439
|
```js
|
|
467
440
|
await sock.sendMessage(jid, { react: { text: '❤️', key: m.key } })
|
|
@@ -470,12 +443,9 @@ await sock.sendMessage(jid, { react: { text: '❤️', key: m.key } })
|
|
|
470
443
|
await sock.sendMessage(jid, { react: { text: '', key: m.key } })
|
|
471
444
|
```
|
|
472
445
|
|
|
473
|
-
</details>
|
|
474
|
-
|
|
475
446
|
---
|
|
476
447
|
|
|
477
|
-
|
|
478
|
-
<summary>📊 Poll</summary>
|
|
448
|
+
## 📊 Poll
|
|
479
449
|
|
|
480
450
|
```js
|
|
481
451
|
await sock.sendMessage(jid, {
|
|
@@ -511,12 +481,9 @@ await sock.sendMessage(jid, {
|
|
|
511
481
|
})
|
|
512
482
|
```
|
|
513
483
|
|
|
514
|
-
</details>
|
|
515
|
-
|
|
516
484
|
---
|
|
517
485
|
|
|
518
|
-
|
|
519
|
-
<summary>📈 Poll Result</summary>
|
|
486
|
+
## 📈 Poll Result
|
|
520
487
|
|
|
521
488
|
```js
|
|
522
489
|
await sock.sendMessage(jid, {
|
|
@@ -531,12 +498,9 @@ await sock.sendMessage(jid, {
|
|
|
531
498
|
})
|
|
532
499
|
```
|
|
533
500
|
|
|
534
|
-
</details>
|
|
535
|
-
|
|
536
501
|
---
|
|
537
502
|
|
|
538
|
-
|
|
539
|
-
<summary>🔄 Poll Update</summary>
|
|
503
|
+
## 🔄 Poll Update
|
|
540
504
|
|
|
541
505
|
```js
|
|
542
506
|
await sock.sendMessage(jid, {
|
|
@@ -548,12 +512,9 @@ await sock.sendMessage(jid, {
|
|
|
548
512
|
})
|
|
549
513
|
```
|
|
550
514
|
|
|
551
|
-
</details>
|
|
552
|
-
|
|
553
515
|
---
|
|
554
516
|
|
|
555
|
-
|
|
556
|
-
<summary>↗️ Forward</summary>
|
|
517
|
+
## ↗️ Forward
|
|
557
518
|
|
|
558
519
|
```js
|
|
559
520
|
await sock.sendMessage(jid, {
|
|
@@ -562,23 +523,17 @@ await sock.sendMessage(jid, {
|
|
|
562
523
|
})
|
|
563
524
|
```
|
|
564
525
|
|
|
565
|
-
</details>
|
|
566
|
-
|
|
567
526
|
---
|
|
568
527
|
|
|
569
|
-
|
|
570
|
-
<summary>🗑️ Hapus Pesan</summary>
|
|
528
|
+
## 🗑️ Hapus Pesan
|
|
571
529
|
|
|
572
530
|
```js
|
|
573
531
|
await sock.sendMessage(jid, { delete: m.key })
|
|
574
532
|
```
|
|
575
533
|
|
|
576
|
-
</details>
|
|
577
|
-
|
|
578
534
|
---
|
|
579
535
|
|
|
580
|
-
|
|
581
|
-
<summary>✏️ Edit Pesan</summary>
|
|
536
|
+
## ✏️ Edit Pesan
|
|
582
537
|
|
|
583
538
|
```js
|
|
584
539
|
await sock.sendMessage(jid, {
|
|
@@ -587,12 +542,9 @@ await sock.sendMessage(jid, {
|
|
|
587
542
|
})
|
|
588
543
|
```
|
|
589
544
|
|
|
590
|
-
</details>
|
|
591
|
-
|
|
592
545
|
---
|
|
593
546
|
|
|
594
|
-
|
|
595
|
-
<summary>📌 Pin Pesan</summary>
|
|
547
|
+
## 📌 Pin Pesan
|
|
596
548
|
|
|
597
549
|
```js
|
|
598
550
|
// Pin
|
|
@@ -606,12 +558,9 @@ await sock.sendMessage(jid, {
|
|
|
606
558
|
await sock.sendMessage(jid, { pin: m.key, type: 2 })
|
|
607
559
|
```
|
|
608
560
|
|
|
609
|
-
</details>
|
|
610
|
-
|
|
611
561
|
---
|
|
612
562
|
|
|
613
|
-
|
|
614
|
-
<summary>🗂️ Album</summary>
|
|
563
|
+
## 🗂️ Album
|
|
615
564
|
|
|
616
565
|
```js
|
|
617
566
|
await sock.sendMessage(jid, {
|
|
@@ -624,12 +573,9 @@ await sock.sendMessage(jid, {
|
|
|
624
573
|
// minimal 2 media
|
|
625
574
|
```
|
|
626
575
|
|
|
627
|
-
</details>
|
|
628
|
-
|
|
629
576
|
---
|
|
630
577
|
|
|
631
|
-
|
|
632
|
-
<summary>📅 Event</summary>
|
|
578
|
+
## 📅 Event
|
|
633
579
|
|
|
634
580
|
```js
|
|
635
581
|
await sock.sendMessage(jid, {
|
|
@@ -658,12 +604,9 @@ await sock.sendMessage(jid, {
|
|
|
658
604
|
})
|
|
659
605
|
```
|
|
660
606
|
|
|
661
|
-
</details>
|
|
662
|
-
|
|
663
607
|
---
|
|
664
608
|
|
|
665
|
-
|
|
666
|
-
<summary>📖 Group Status / Group Story</summary>
|
|
609
|
+
## 📖 Group Status / Group Story
|
|
667
610
|
|
|
668
611
|
```js
|
|
669
612
|
// Teks
|
|
@@ -705,14 +648,103 @@ await sock.sendMessage(groupJid, {
|
|
|
705
648
|
})
|
|
706
649
|
```
|
|
707
650
|
|
|
708
|
-
> **Catatan
|
|
651
|
+
> **Catatan audio:** Saat audio dikirim sebagai group status (`groupStatusMessageV2`), pesan dikirim dengan `type="text"` dan tanpa `mediatype` attribute — perilaku sama dengan Baileys upstream. Berbeda dengan media lain (gambar/video) yang dikirim dengan `type="media"`.
|
|
652
|
+
|
|
653
|
+
---
|
|
654
|
+
|
|
655
|
+
## 🏷️ Status Mention
|
|
656
|
+
|
|
657
|
+
```js
|
|
658
|
+
// Kirim ke array JID untuk trigger status mention
|
|
659
|
+
await sock.sendMessage(['628xxx@s.whatsapp.net', 'yyy@g.us'], {
|
|
660
|
+
text: 'Hei kamu!',
|
|
661
|
+
backgroundColor: '#ff6b9d'
|
|
662
|
+
})
|
|
663
|
+
|
|
664
|
+
// Gambar dengan mention
|
|
665
|
+
await sock.sendMessage(['628xxx@s.whatsapp.net'], {
|
|
666
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
667
|
+
caption: 'Untuk kamu'
|
|
668
|
+
})
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
> Untuk grup, otomatis pakai `groupStatusMentionMessage`.
|
|
672
|
+
|
|
673
|
+
---
|
|
674
|
+
|
|
675
|
+
## 📡 Channel (Newsletter)
|
|
676
|
+
|
|
677
|
+
> **Fix v0.1.16** — Pengiriman media ke channel sebelumnya tidak berfungsi karena dua bug: `mediatype` attribute tidak dikirim ke server dan thumbnail tidak digenerate. Keduanya sudah diperbaiki di versi ini.
|
|
678
|
+
|
|
679
|
+
> Hanya **admin/owner** channel yang bisa posting. JID channel menggunakan format `@newsletter`.
|
|
709
680
|
|
|
710
|
-
|
|
681
|
+
```js
|
|
682
|
+
const channelJid = '120363425154682710@newsletter'
|
|
683
|
+
|
|
684
|
+
// Teks
|
|
685
|
+
await sock.sendMessage(channelJid, { text: 'Halo dari channel!' })
|
|
686
|
+
|
|
687
|
+
// Gambar dari URL
|
|
688
|
+
await sock.sendMessage(channelJid, {
|
|
689
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
690
|
+
caption: 'Keterangan gambar'
|
|
691
|
+
})
|
|
692
|
+
|
|
693
|
+
// Gambar dari file lokal
|
|
694
|
+
await sock.sendMessage(channelJid, {
|
|
695
|
+
image: { url: './gambar.jpg' },
|
|
696
|
+
caption: 'Dari file lokal'
|
|
697
|
+
})
|
|
698
|
+
|
|
699
|
+
// Gambar dari Buffer
|
|
700
|
+
await sock.sendMessage(channelJid, {
|
|
701
|
+
image: fs.readFileSync('gambar.jpg'),
|
|
702
|
+
caption: 'Dari buffer'
|
|
703
|
+
})
|
|
704
|
+
|
|
705
|
+
// Video
|
|
706
|
+
await sock.sendMessage(channelJid, {
|
|
707
|
+
video: { url: 'https://example.com/video.mp4' },
|
|
708
|
+
caption: 'Keterangan video'
|
|
709
|
+
})
|
|
710
|
+
|
|
711
|
+
// Audio
|
|
712
|
+
await sock.sendMessage(channelJid, {
|
|
713
|
+
audio: { url: 'https://example.com/audio.mp3' },
|
|
714
|
+
mimetype: 'audio/mpeg'
|
|
715
|
+
})
|
|
716
|
+
|
|
717
|
+
// Dokumen
|
|
718
|
+
await sock.sendMessage(channelJid, {
|
|
719
|
+
document: { url: 'https://example.com/file.pdf' },
|
|
720
|
+
mimetype: 'application/pdf',
|
|
721
|
+
fileName: 'dokumen.pdf'
|
|
722
|
+
})
|
|
723
|
+
|
|
724
|
+
// Poll
|
|
725
|
+
await sock.sendMessage(channelJid, {
|
|
726
|
+
poll: {
|
|
727
|
+
name: 'Pertanyaan untuk subscriber',
|
|
728
|
+
values: ['Opsi A', 'Opsi B', 'Opsi C'],
|
|
729
|
+
selectableCount: 1
|
|
730
|
+
}
|
|
731
|
+
})
|
|
732
|
+
|
|
733
|
+
// Edit pesan channel
|
|
734
|
+
await sock.sendMessage(channelJid, {
|
|
735
|
+
text: 'Teks yang sudah diedit',
|
|
736
|
+
edit: pesanLama.key
|
|
737
|
+
})
|
|
738
|
+
|
|
739
|
+
// Hapus pesan channel
|
|
740
|
+
await sock.sendMessage(channelJid, { delete: pesanLama.key })
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
> **Catatan:** Channel tidak mendukung enkripsi E2E — media di-upload sebagai file mentah (unencrypted), berbeda dengan chat biasa.
|
|
711
744
|
|
|
712
745
|
---
|
|
713
746
|
|
|
714
|
-
|
|
715
|
-
<summary>🔁 Flow Reply</summary>
|
|
747
|
+
## 🔁 Flow Reply
|
|
716
748
|
|
|
717
749
|
```js
|
|
718
750
|
await sock.sendMessage(jid, {
|
|
@@ -726,12 +758,9 @@ await sock.sendMessage(jid, {
|
|
|
726
758
|
})
|
|
727
759
|
```
|
|
728
760
|
|
|
729
|
-
</details>
|
|
730
|
-
|
|
731
761
|
---
|
|
732
762
|
|
|
733
|
-
|
|
734
|
-
<summary>🔘 Button Reply</summary>
|
|
763
|
+
## 🔘 Button Reply
|
|
735
764
|
|
|
736
765
|
```js
|
|
737
766
|
// Template button
|
|
@@ -747,12 +776,9 @@ await sock.sendMessage(jid, {
|
|
|
747
776
|
})
|
|
748
777
|
```
|
|
749
778
|
|
|
750
|
-
</details>
|
|
751
|
-
|
|
752
779
|
---
|
|
753
780
|
|
|
754
|
-
|
|
755
|
-
<summary>📎 Keep In Chat</summary>
|
|
781
|
+
## 📎 Keep In Chat
|
|
756
782
|
|
|
757
783
|
```js
|
|
758
784
|
await sock.sendMessage(jid, {
|
|
@@ -761,12 +787,9 @@ await sock.sendMessage(jid, {
|
|
|
761
787
|
})
|
|
762
788
|
```
|
|
763
789
|
|
|
764
|
-
</details>
|
|
765
|
-
|
|
766
790
|
---
|
|
767
791
|
|
|
768
|
-
|
|
769
|
-
<summary>📞 Scheduled Call</summary>
|
|
792
|
+
## 📞 Scheduled Call
|
|
770
793
|
|
|
771
794
|
```js
|
|
772
795
|
await sock.sendMessage(jid, {
|
|
@@ -778,12 +801,9 @@ await sock.sendMessage(jid, {
|
|
|
778
801
|
})
|
|
779
802
|
```
|
|
780
803
|
|
|
781
|
-
</details>
|
|
782
|
-
|
|
783
804
|
---
|
|
784
805
|
|
|
785
|
-
|
|
786
|
-
<summary>🔗 Group Invite</summary>
|
|
806
|
+
## 🔗 Group Invite
|
|
787
807
|
|
|
788
808
|
```js
|
|
789
809
|
await sock.sendMessage(jid, {
|
|
@@ -797,12 +817,9 @@ await sock.sendMessage(jid, {
|
|
|
797
817
|
})
|
|
798
818
|
```
|
|
799
819
|
|
|
800
|
-
</details>
|
|
801
|
-
|
|
802
820
|
---
|
|
803
821
|
|
|
804
|
-
|
|
805
|
-
<summary>🛍️ Product</summary>
|
|
822
|
+
## 🛍️ Product
|
|
806
823
|
|
|
807
824
|
```js
|
|
808
825
|
await sock.sendMessage(jid, {
|
|
@@ -820,12 +837,9 @@ await sock.sendMessage(jid, {
|
|
|
820
837
|
})
|
|
821
838
|
```
|
|
822
839
|
|
|
823
|
-
</details>
|
|
824
|
-
|
|
825
840
|
---
|
|
826
841
|
|
|
827
|
-
|
|
828
|
-
<summary>👁️ View Once</summary>
|
|
842
|
+
## 👁️ View Once
|
|
829
843
|
|
|
830
844
|
```js
|
|
831
845
|
await sock.sendMessage(jid, {
|
|
@@ -834,12 +848,9 @@ await sock.sendMessage(jid, {
|
|
|
834
848
|
})
|
|
835
849
|
```
|
|
836
850
|
|
|
837
|
-
</details>
|
|
838
|
-
|
|
839
851
|
---
|
|
840
852
|
|
|
841
|
-
|
|
842
|
-
<summary>👁️ View Once V2</summary>
|
|
853
|
+
## 👁️ View Once V2
|
|
843
854
|
|
|
844
855
|
```js
|
|
845
856
|
await sock.sendMessage(jid, {
|
|
@@ -854,12 +865,9 @@ await sock.sendMessage(jid, {
|
|
|
854
865
|
})
|
|
855
866
|
```
|
|
856
867
|
|
|
857
|
-
</details>
|
|
858
|
-
|
|
859
868
|
---
|
|
860
869
|
|
|
861
|
-
|
|
862
|
-
<summary>⏳ Ephemeral</summary>
|
|
870
|
+
## ⏳ Ephemeral
|
|
863
871
|
|
|
864
872
|
```js
|
|
865
873
|
await sock.sendMessage(jid, {
|
|
@@ -868,12 +876,9 @@ await sock.sendMessage(jid, {
|
|
|
868
876
|
})
|
|
869
877
|
```
|
|
870
878
|
|
|
871
|
-
</details>
|
|
872
|
-
|
|
873
879
|
---
|
|
874
880
|
|
|
875
|
-
|
|
876
|
-
<summary>🙈 Spoiler</summary>
|
|
881
|
+
## 🙈 Spoiler
|
|
877
882
|
|
|
878
883
|
```js
|
|
879
884
|
await sock.sendMessage(jid, {
|
|
@@ -883,12 +888,9 @@ await sock.sendMessage(jid, {
|
|
|
883
888
|
})
|
|
884
889
|
```
|
|
885
890
|
|
|
886
|
-
</details>
|
|
887
|
-
|
|
888
891
|
---
|
|
889
892
|
|
|
890
|
-
|
|
891
|
-
<summary>🎭 Group Status Wrap</summary>
|
|
893
|
+
## 🎭 Group Status Wrap
|
|
892
894
|
|
|
893
895
|
Wrapper `groupStatus: true` membungkus pesan apapun ke dalam `groupStatusMessageV2` secara otomatis.
|
|
894
896
|
|
|
@@ -916,12 +918,9 @@ await sock.sendMessage(jid, {
|
|
|
916
918
|
|
|
917
919
|
> **Catatan audio:** Pesan audio yang dibungkus `groupStatus: true` dikirim dengan `type="text"` dan tanpa `mediatype` (perilaku Baileys upstream). Ini hanya berlaku untuk audio — gambar dan video tetap dikirim sebagai `type="media"`.
|
|
918
920
|
|
|
919
|
-
</details>
|
|
920
|
-
|
|
921
921
|
---
|
|
922
922
|
|
|
923
|
-
|
|
924
|
-
<summary>🎞️ Lottie Sticker</summary>
|
|
923
|
+
## 🎞️ Lottie Sticker
|
|
925
924
|
|
|
926
925
|
```js
|
|
927
926
|
await sock.sendMessage(jid, {
|
|
@@ -930,12 +929,9 @@ await sock.sendMessage(jid, {
|
|
|
930
929
|
})
|
|
931
930
|
```
|
|
932
931
|
|
|
933
|
-
</details>
|
|
934
|
-
|
|
935
932
|
---
|
|
936
933
|
|
|
937
|
-
|
|
938
|
-
<summary>🤖 AI Icon</summary>
|
|
934
|
+
## 🤖 AI Icon
|
|
939
935
|
|
|
940
936
|
```js
|
|
941
937
|
// Hanya untuk private chat (bukan grup)
|
|
@@ -948,12 +944,9 @@ await sock.sendMessage(jid, {
|
|
|
948
944
|
})
|
|
949
945
|
```
|
|
950
946
|
|
|
951
|
-
</details>
|
|
952
|
-
|
|
953
947
|
---
|
|
954
948
|
|
|
955
|
-
|
|
956
|
-
<summary>🔒 Secure Meta Service Label</summary>
|
|
949
|
+
## 🔒 Secure Meta Service Label
|
|
957
950
|
|
|
958
951
|
```js
|
|
959
952
|
await sock.sendMessage(jid, {
|
|
@@ -962,12 +955,9 @@ await sock.sendMessage(jid, {
|
|
|
962
955
|
})
|
|
963
956
|
```
|
|
964
957
|
|
|
965
|
-
</details>
|
|
966
|
-
|
|
967
958
|
---
|
|
968
959
|
|
|
969
|
-
|
|
970
|
-
<summary>📍 Buttons dengan Location Header (buttonsMessage langsung)</summary>
|
|
960
|
+
## 📍 Buttons dengan Location Header
|
|
971
961
|
|
|
972
962
|
Kirim tombol menggunakan `buttonsMessage` secara langsung — berguna untuk header tipe **Location** (`headerType: 6`) yang tidak bisa dibuat lewat shorthand `buttons`.
|
|
973
963
|
|
|
@@ -991,33 +981,13 @@ await sock.sendMessage(jid, {
|
|
|
991
981
|
}
|
|
992
982
|
})
|
|
993
983
|
|
|
994
|
-
//
|
|
995
|
-
await sock.sendMessage(jid, {
|
|
996
|
-
buttonsMessage: {
|
|
997
|
-
locationMessage: {
|
|
998
|
-
degreesLatitude: -6.2,
|
|
999
|
-
degreesLongitude: 106.8,
|
|
1000
|
-
name: 'Menu Bot',
|
|
1001
|
-
address: 'NuiiSweety',
|
|
1002
|
-
jpegThumbnail: './src/img/menu.jpg'
|
|
1003
|
-
},
|
|
1004
|
-
contentText: 'Halo! Ini menu utama bot',
|
|
1005
|
-
footerText: 'NuiiSweety Bot',
|
|
1006
|
-
buttons: [
|
|
1007
|
-
{ buttonId: 'menu1', buttonText: { displayText: '🍱 Menu Utama' }, type: 1 },
|
|
1008
|
-
{ buttonId: 'help', buttonText: { displayText: '❓ Bantuan' }, type: 1 }
|
|
1009
|
-
],
|
|
1010
|
-
headerType: 6
|
|
1011
|
-
}
|
|
1012
|
-
}, { quoted: m })
|
|
1013
|
-
|
|
1014
|
-
// Header kosong (teks saja, tanpa media/lokasi) — headerType 1
|
|
984
|
+
// Header kosong (teks saja) — headerType 1
|
|
1015
985
|
await sock.sendMessage(jid, {
|
|
1016
986
|
buttonsMessage: {
|
|
1017
987
|
contentText: 'Pilih opsi',
|
|
1018
988
|
footerText: 'Bot Footer',
|
|
1019
989
|
buttons: [
|
|
1020
|
-
{ buttonId: 'yes', buttonText: { displayText: 'Ya' },
|
|
990
|
+
{ buttonId: 'yes', buttonText: { displayText: 'Ya' }, type: 1 },
|
|
1021
991
|
{ buttonId: 'no', buttonText: { displayText: 'Tidak' }, type: 1 }
|
|
1022
992
|
],
|
|
1023
993
|
headerType: 1
|
|
@@ -1025,23 +995,21 @@ await sock.sendMessage(jid, {
|
|
|
1025
995
|
})
|
|
1026
996
|
```
|
|
1027
997
|
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
> `jpegThumbnail` pada `locationMessage` bisa berupa **path file lokal**, **URL**, atau **Buffer** — otomatis diproses oleh Baileys.
|
|
998
|
+
**Nilai `headerType`:**
|
|
999
|
+
|
|
1000
|
+
| Nilai | Tipe Header |
|
|
1001
|
+
|:-----:|-------------|
|
|
1002
|
+
| `1` | Teks (`contentText`) |
|
|
1003
|
+
| `2` | Gambar (`imageMessage`) |
|
|
1004
|
+
| `3` | Video (`videoMessage`) |
|
|
1005
|
+
| `4` | Dokumen (`documentMessage`) |
|
|
1006
|
+
| `6` | Lokasi (`locationMessage`) |
|
|
1038
1007
|
|
|
1039
|
-
|
|
1008
|
+
> `jpegThumbnail` pada `locationMessage` bisa berupa **path file lokal**, **URL**, atau **Buffer** — otomatis diproses oleh Baileys.
|
|
1040
1009
|
|
|
1041
1010
|
---
|
|
1042
1011
|
|
|
1043
|
-
|
|
1044
|
-
<summary>🎛️ Buttons</summary>
|
|
1012
|
+
## 🎛️ Buttons
|
|
1045
1013
|
|
|
1046
1014
|
```js
|
|
1047
1015
|
// Teks dengan tombol (quick reply)
|
|
@@ -1066,27 +1034,6 @@ await sock.sendMessage(jid, {
|
|
|
1066
1034
|
]
|
|
1067
1035
|
})
|
|
1068
1036
|
|
|
1069
|
-
// Native flow button dalam buttons — pakai name + paramsJson
|
|
1070
|
-
await sock.sendMessage(jid, {
|
|
1071
|
-
text: 'Pilih menu',
|
|
1072
|
-
buttons: [
|
|
1073
|
-
{
|
|
1074
|
-
name: 'single_select',
|
|
1075
|
-
text: 'Buka Menu',
|
|
1076
|
-
paramsJson: JSON.stringify({
|
|
1077
|
-
title: 'Buka Menu',
|
|
1078
|
-
sections: [{
|
|
1079
|
-
title: 'Kategori A',
|
|
1080
|
-
rows: [
|
|
1081
|
-
{ id: 'row1', title: 'Item 1', description: 'Deskripsi' },
|
|
1082
|
-
{ id: 'row2', title: 'Item 2' }
|
|
1083
|
-
]
|
|
1084
|
-
}]
|
|
1085
|
-
})
|
|
1086
|
-
}
|
|
1087
|
-
]
|
|
1088
|
-
})
|
|
1089
|
-
|
|
1090
1037
|
// Shorthand: sections langsung di button (otomatis jadi single_select)
|
|
1091
1038
|
await sock.sendMessage(jid, {
|
|
1092
1039
|
text: 'Pilih menu',
|
|
@@ -1103,14 +1050,11 @@ await sock.sendMessage(jid, {
|
|
|
1103
1050
|
})
|
|
1104
1051
|
```
|
|
1105
1052
|
|
|
1106
|
-
> **Field tombol:** gunakan `text` atau `buttonText` untuk label.
|
|
1107
|
-
|
|
1108
|
-
</details>
|
|
1053
|
+
> **Field tombol:** gunakan `text` atau `buttonText` untuk label. Quick reply pakai `id`/`buttonId`. Native flow pakai `name` + `paramsJson`.
|
|
1109
1054
|
|
|
1110
1055
|
---
|
|
1111
1056
|
|
|
1112
|
-
|
|
1113
|
-
<summary>📋 List Message</summary>
|
|
1057
|
+
## 📋 List Message
|
|
1114
1058
|
|
|
1115
1059
|
```js
|
|
1116
1060
|
await sock.sendMessage(jid, {
|
|
@@ -1136,21 +1080,18 @@ await sock.sendMessage(jid, {
|
|
|
1136
1080
|
})
|
|
1137
1081
|
```
|
|
1138
1082
|
|
|
1139
|
-
> **Trigger key:** `sections
|
|
1140
|
-
|
|
1141
|
-
</details>
|
|
1083
|
+
> **Trigger key:** `sections`. `listType` otomatis di-set ke `SINGLE_SELECT`. Field `text` di-map ke `description` — gunakan `title` untuk judul list.
|
|
1142
1084
|
|
|
1143
1085
|
---
|
|
1144
1086
|
|
|
1145
|
-
|
|
1146
|
-
<summary>🗃️ Template Buttons</summary>
|
|
1087
|
+
## 🗃️ Template Buttons
|
|
1147
1088
|
|
|
1148
1089
|
```js
|
|
1149
1090
|
// Teks
|
|
1150
1091
|
await sock.sendMessage(jid, {
|
|
1151
|
-
text: 'Pesan template',
|
|
1152
|
-
footer: 'Footer',
|
|
1153
|
-
id: 'template-unik',
|
|
1092
|
+
text: 'Pesan template',
|
|
1093
|
+
footer: 'Footer',
|
|
1094
|
+
id: 'template-unik', // opsional, auto-generate jika tidak diisi
|
|
1154
1095
|
templateButtons: [
|
|
1155
1096
|
{ id: 'btn1', text: 'Quick Reply' },
|
|
1156
1097
|
{ url: 'https://example.com', text: 'Kunjungi Website' },
|
|
@@ -1161,8 +1102,8 @@ await sock.sendMessage(jid, {
|
|
|
1161
1102
|
// Gambar sebagai header
|
|
1162
1103
|
await sock.sendMessage(jid, {
|
|
1163
1104
|
image: { url: 'https://example.com/img.jpg' },
|
|
1164
|
-
caption: 'Isi pesan',
|
|
1165
|
-
title: 'Judul',
|
|
1105
|
+
caption: 'Isi pesan',
|
|
1106
|
+
title: 'Judul',
|
|
1166
1107
|
footer: 'Footer',
|
|
1167
1108
|
templateButtons: [
|
|
1168
1109
|
{ id: 'btn1', text: 'Klik Sini' },
|
|
@@ -1171,14 +1112,11 @@ await sock.sendMessage(jid, {
|
|
|
1171
1112
|
})
|
|
1172
1113
|
```
|
|
1173
1114
|
|
|
1174
|
-
> **Tipe tombol:** `{ id, text }` → quick reply
|
|
1175
|
-
|
|
1176
|
-
</details>
|
|
1115
|
+
> **Tipe tombol:** `{ id, text }` → quick reply · `{ url, text }` → URL button · `{ call, text }` → call button.
|
|
1177
1116
|
|
|
1178
1117
|
---
|
|
1179
1118
|
|
|
1180
|
-
|
|
1181
|
-
<summary>🌊 Native Flow</summary>
|
|
1119
|
+
## 🌊 Native Flow
|
|
1182
1120
|
|
|
1183
1121
|
```js
|
|
1184
1122
|
// Quick reply
|
|
@@ -1186,7 +1124,7 @@ await sock.sendMessage(jid, {
|
|
|
1186
1124
|
text: 'Pilih aksi',
|
|
1187
1125
|
footer: 'Footer pesan',
|
|
1188
1126
|
nativeFlow: [
|
|
1189
|
-
{ id: '1', text: 'Opsi 1' },
|
|
1127
|
+
{ id: '1', text: 'Opsi 1' },
|
|
1190
1128
|
{ id: '2', text: 'Opsi 2' }
|
|
1191
1129
|
]
|
|
1192
1130
|
})
|
|
@@ -1232,38 +1170,19 @@ await sock.sendMessage(jid, {
|
|
|
1232
1170
|
]
|
|
1233
1171
|
})
|
|
1234
1172
|
|
|
1235
|
-
//
|
|
1236
|
-
await sock.sendMessage(jid, {
|
|
1237
|
-
text: 'Pilih aksi',
|
|
1238
|
-
nativeFlow: [
|
|
1239
|
-
{ id: '1', text: 'Konfirmasi', icon: 'CHECK' },
|
|
1240
|
-
{ url: 'https://example.com', text: 'Buka', icon: 'LINK' }
|
|
1241
|
-
]
|
|
1242
|
-
})
|
|
1243
|
-
|
|
1244
|
-
// Gambar sebagai header — WAJIB pakai image/video/document/location/product
|
|
1245
|
-
// jika tidak ada media valid → throw Error: Invalid media type
|
|
1173
|
+
// Gambar sebagai header
|
|
1246
1174
|
await sock.sendMessage(jid, {
|
|
1247
1175
|
image: { url: 'https://example.com/img.jpg' },
|
|
1248
|
-
caption: 'Isi pesan',
|
|
1249
|
-
title: 'Judul',
|
|
1250
|
-
subtitle: 'Subjudul',
|
|
1176
|
+
caption: 'Isi pesan',
|
|
1177
|
+
title: 'Judul',
|
|
1178
|
+
subtitle: 'Subjudul',
|
|
1251
1179
|
footer: 'Footer',
|
|
1252
1180
|
nativeFlow: [
|
|
1253
1181
|
{ id: '1', text: 'Tombol 1' }
|
|
1254
1182
|
]
|
|
1255
1183
|
})
|
|
1256
1184
|
|
|
1257
|
-
//
|
|
1258
|
-
await sock.sendMessage(jid, {
|
|
1259
|
-
text: 'Pesan dengan audio footer',
|
|
1260
|
-
audioFooter: fs.readFileSync('audio.ogg'),
|
|
1261
|
-
nativeFlow: [
|
|
1262
|
-
{ id: '1', text: 'OK' }
|
|
1263
|
-
]
|
|
1264
|
-
})
|
|
1265
|
-
|
|
1266
|
-
// offerText — tampil sebagai limited time offer banner
|
|
1185
|
+
// offerText — limited time offer banner
|
|
1267
1186
|
await sock.sendMessage(jid, {
|
|
1268
1187
|
text: 'Penawaran terbatas!',
|
|
1269
1188
|
offerText: 'Diskon 50%',
|
|
@@ -1275,7 +1194,7 @@ await sock.sendMessage(jid, {
|
|
|
1275
1194
|
]
|
|
1276
1195
|
})
|
|
1277
1196
|
|
|
1278
|
-
// optionText — tombol
|
|
1197
|
+
// optionText — tombol masuk ke bottom sheet
|
|
1279
1198
|
await sock.sendMessage(jid, {
|
|
1280
1199
|
text: 'Pilih opsi',
|
|
1281
1200
|
optionText: 'Lihat Semua Opsi',
|
|
@@ -1285,26 +1204,13 @@ await sock.sendMessage(jid, {
|
|
|
1285
1204
|
{ id: '2', text: 'Opsi B' }
|
|
1286
1205
|
]
|
|
1287
1206
|
})
|
|
1288
|
-
|
|
1289
|
-
// Wrap sebagai templateMessage
|
|
1290
|
-
await sock.sendMessage(jid, {
|
|
1291
|
-
text: 'Template interaktif',
|
|
1292
|
-
nativeFlow: [
|
|
1293
|
-
{ id: '1', text: 'Tombol' }
|
|
1294
|
-
],
|
|
1295
|
-
interactiveAsTemplate: true,
|
|
1296
|
-
id: 'template-id-unik'
|
|
1297
|
-
})
|
|
1298
1207
|
```
|
|
1299
1208
|
|
|
1300
|
-
> **Tipe tombol ditentukan otomatis
|
|
1301
|
-
|
|
1302
|
-
</details>
|
|
1209
|
+
> **Tipe tombol ditentukan otomatis:** `id` → quick_reply · `url` → cta_url · `copy` → cta_copy · `call` → cta_call · `sections` → single_select. Field `icon` opsional (contoh: `'CHECK'`, `'LINK'`).
|
|
1303
1210
|
|
|
1304
1211
|
---
|
|
1305
1212
|
|
|
1306
|
-
|
|
1307
|
-
<summary>🎠 Carousel</summary>
|
|
1213
|
+
## 🎠 Carousel
|
|
1308
1214
|
|
|
1309
1215
|
```js
|
|
1310
1216
|
await sock.sendMessage(jid, {
|
|
@@ -1332,48 +1238,20 @@ await sock.sendMessage(jid, {
|
|
|
1332
1238
|
})
|
|
1333
1239
|
```
|
|
1334
1240
|
|
|
1335
|
-
</details>
|
|
1336
|
-
|
|
1337
1241
|
---
|
|
1338
1242
|
|
|
1339
|
-
|
|
1340
|
-
<summary>🏷️ Status Mention</summary>
|
|
1341
|
-
|
|
1342
|
-
```js
|
|
1343
|
-
// Kirim ke array JID untuk trigger status mention
|
|
1344
|
-
await sock.sendMessage(['628xxx@s.whatsapp.net', 'yyy@g.us'], {
|
|
1345
|
-
text: 'Hei kamu!',
|
|
1346
|
-
backgroundColor: '#ff6b9d'
|
|
1347
|
-
})
|
|
1348
|
-
|
|
1349
|
-
// Gambar dengan mention
|
|
1350
|
-
await sock.sendMessage(['628xxx@s.whatsapp.net'], {
|
|
1351
|
-
image: { url: 'https://example.com/image.jpg' },
|
|
1352
|
-
caption: 'Untuk kamu'
|
|
1353
|
-
})
|
|
1354
|
-
```
|
|
1243
|
+
## 🤖 Rich Message (AI)
|
|
1355
1244
|
|
|
1356
|
-
>
|
|
1245
|
+
> Rich message menggunakan format `AIRichResponseMessage` yang tampil seperti respons AI di WhatsApp. Semua tipe bisa dipakai secara flat (field langsung) atau dikombinasikan via `richResponse: [...]`.
|
|
1357
1246
|
|
|
1358
|
-
|
|
1247
|
+
> ⚠️ **Penting:** `contentText`, `headerText`, `footerText`, dan `disclaimerText` **bukan** trigger key. Jika hanya field itu yang dikirim, pesan tidak akan diproses sebagai rich message dan menghasilkan **Error: Invalid media type**. Selalu sertakan minimal satu trigger key (`code`, `table`, `richImage`, `richVideo`, `richResponse`, dll).
|
|
1359
1248
|
|
|
1360
1249
|
---
|
|
1361
1250
|
|
|
1362
|
-
<details>
|
|
1363
|
-
<summary>🤖 Rich Message (AI)</summary>
|
|
1364
|
-
|
|
1365
|
-
> Rich message menggunakan format `AIRichResponseMessage` yang tampil seperti respons AI di WhatsApp. Semua tipe di bawah bisa dipakai secara flat (field langsung) atau dikombinasikan via `richResponse: [...]`.
|
|
1366
|
-
|
|
1367
|
-
> ⚠️ **Penting:** `contentText`, `headerText`, `footerText`, dan `disclaimerText` **bukan** trigger key — artinya jika hanya field itu yang dikirim, pesan **tidak akan** diproses sebagai rich message dan akan menghasilkan **Error: Invalid media type**. Gunakan selalu minimal satu trigger key (`code`, `table`, `richImage`, `richVideo`, `richResponse`, dll), lalu kombinasikan dengan field teks di atas sebagai pelengkap.
|
|
1368
|
-
|
|
1369
1251
|
### ✍️ addText
|
|
1370
1252
|
|
|
1371
|
-
Kirim teks markdown sebagai AI Rich Response. Mendukung hyperlink, citation, dan LaTeX inline.
|
|
1372
|
-
|
|
1373
|
-
Karena `contentText` bukan trigger key, gunakan `richResponse: [{ text }]` untuk pesan teks murni:
|
|
1374
|
-
|
|
1375
1253
|
```js
|
|
1376
|
-
// ✅ Cara benar — pakai richResponse array
|
|
1254
|
+
// ✅ Cara benar — pakai richResponse array untuk teks murni
|
|
1377
1255
|
await sock.sendMessage(jid, {
|
|
1378
1256
|
richResponse: [
|
|
1379
1257
|
{ text: 'Ini teks dari AI dengan *markdown* dan **bold**.' }
|
|
@@ -1385,24 +1263,10 @@ await sock.sendMessage(jid, {
|
|
|
1385
1263
|
```
|
|
1386
1264
|
|
|
1387
1265
|
```js
|
|
1388
|
-
//
|
|
1389
|
-
await sock.sendMessage(jid, {
|
|
1390
|
-
code: 'console.log("Hello")',
|
|
1391
|
-
language: 'javascript',
|
|
1392
|
-
contentText: 'Penjelasan tambahan di sini.',
|
|
1393
|
-
headerText: 'Judul',
|
|
1394
|
-
footerText: 'Footer',
|
|
1395
|
-
disclaimerText: 'Generated by AI'
|
|
1396
|
-
})
|
|
1397
|
-
```
|
|
1398
|
-
|
|
1399
|
-
```js
|
|
1400
|
-
// ❌ SALAH — contentText saja tidak akan trigger rich message
|
|
1266
|
+
// ❌ SALAH — contentText saja tidak trigger rich message
|
|
1401
1267
|
await sock.sendMessage(jid, {
|
|
1402
1268
|
contentText: 'halooo',
|
|
1403
|
-
headerText: 'Judul'
|
|
1404
|
-
footerText: 'Footer',
|
|
1405
|
-
disclaimerText: 'Generated by AI'
|
|
1269
|
+
headerText: 'Judul'
|
|
1406
1270
|
// → Error: Invalid media type
|
|
1407
1271
|
})
|
|
1408
1272
|
```
|
|
@@ -1411,8 +1275,6 @@ await sock.sendMessage(jid, {
|
|
|
1411
1275
|
|
|
1412
1276
|
### 💻 addCode
|
|
1413
1277
|
|
|
1414
|
-
Kirim blok kode dengan syntax highlighting.
|
|
1415
|
-
|
|
1416
1278
|
```js
|
|
1417
1279
|
await sock.sendMessage(jid, {
|
|
1418
1280
|
code: 'console.log("Hello World!")',
|
|
@@ -1450,8 +1312,6 @@ await sock.sendMessage(jid, {
|
|
|
1450
1312
|
|
|
1451
1313
|
### 📊 addTable
|
|
1452
1314
|
|
|
1453
|
-
Kirim tabel dari array 2D. Baris pertama otomatis menjadi header.
|
|
1454
|
-
|
|
1455
1315
|
```js
|
|
1456
1316
|
await sock.sendMessage(jid, {
|
|
1457
1317
|
table: [
|
|
@@ -1480,8 +1340,6 @@ await sock.sendMessage(jid, {
|
|
|
1480
1340
|
|
|
1481
1341
|
### 🖼️ addImage
|
|
1482
1342
|
|
|
1483
|
-
Kirim satu atau beberapa gambar sebagai grid image di AI Rich Response.
|
|
1484
|
-
|
|
1485
1343
|
```js
|
|
1486
1344
|
// Satu gambar
|
|
1487
1345
|
await sock.sendMessage(jid, {
|
|
@@ -1496,19 +1354,14 @@ await sock.sendMessage(jid, {
|
|
|
1496
1354
|
'https://example.com/photo2.jpg',
|
|
1497
1355
|
'https://example.com/photo3.jpg'
|
|
1498
1356
|
],
|
|
1499
|
-
headerText: 'Koleksi gambar'
|
|
1500
|
-
footerText: 'Semoga suka'
|
|
1357
|
+
headerText: 'Koleksi gambar'
|
|
1501
1358
|
})
|
|
1502
1359
|
```
|
|
1503
1360
|
|
|
1504
|
-
> `image` menerima string URL atau array string URL. Berbeda dengan `gridImage` (format verbose), `image` adalah shorthand yang lebih praktis.
|
|
1505
|
-
|
|
1506
1361
|
---
|
|
1507
1362
|
|
|
1508
1363
|
### 🎬 addVideo
|
|
1509
1364
|
|
|
1510
|
-
Kirim satu atau beberapa video di AI Rich Response.
|
|
1511
|
-
|
|
1512
1365
|
```js
|
|
1513
1366
|
// Satu video
|
|
1514
1367
|
await sock.sendMessage(jid, {
|
|
@@ -1532,14 +1385,10 @@ await sock.sendMessage(jid, {
|
|
|
1532
1385
|
})
|
|
1533
1386
|
```
|
|
1534
1387
|
|
|
1535
|
-
> Format URL video: `'url'` atau `'url|durasi_detik'`. Durasi dalam satuan detik, default 0.
|
|
1536
|
-
|
|
1537
1388
|
---
|
|
1538
1389
|
|
|
1539
1390
|
### 🔗 addSource
|
|
1540
1391
|
|
|
1541
|
-
Kirim daftar sumber referensi/link sebagai search result card.
|
|
1542
|
-
|
|
1543
1392
|
```js
|
|
1544
1393
|
await sock.sendMessage(jid, {
|
|
1545
1394
|
source: [
|
|
@@ -1561,8 +1410,6 @@ await sock.sendMessage(jid, {
|
|
|
1561
1410
|
})
|
|
1562
1411
|
```
|
|
1563
1412
|
|
|
1564
|
-
**Field tiap sumber:**
|
|
1565
|
-
|
|
1566
1413
|
| Field | Tipe | Keterangan |
|
|
1567
1414
|
|-------|------|------------|
|
|
1568
1415
|
| `url` | string | URL tujuan (wajib) |
|
|
@@ -1576,8 +1423,6 @@ await sock.sendMessage(jid, {
|
|
|
1576
1423
|
|
|
1577
1424
|
### 🎥 addReels
|
|
1578
1425
|
|
|
1579
|
-
Kirim daftar reel/video carousel (horizontal scroll) seperti hasil rekomendasi konten.
|
|
1580
|
-
|
|
1581
1426
|
```js
|
|
1582
1427
|
await sock.sendMessage(jid, {
|
|
1583
1428
|
reels: [
|
|
@@ -1589,27 +1434,14 @@ await sock.sendMessage(jid, {
|
|
|
1589
1434
|
reels_title: 'Judul Reel 1',
|
|
1590
1435
|
likes_count: 1200,
|
|
1591
1436
|
view_count: 50000,
|
|
1592
|
-
shares_count: 300,
|
|
1593
1437
|
reel_source: 'IG',
|
|
1594
1438
|
is_verified: true
|
|
1595
|
-
},
|
|
1596
|
-
{
|
|
1597
|
-
username: 'creator2',
|
|
1598
|
-
videoUrl: 'https://example.com/reel2.mp4',
|
|
1599
|
-
thumbnailUrl: 'https://example.com/thumb2.jpg',
|
|
1600
|
-
profileIconUrl: 'https://example.com/avatar2.jpg',
|
|
1601
|
-
reels_title: 'Judul Reel 2',
|
|
1602
|
-
likes_count: 800,
|
|
1603
|
-
view_count: 20000,
|
|
1604
|
-
reel_source: 'TT' // TikTok
|
|
1605
1439
|
}
|
|
1606
1440
|
],
|
|
1607
1441
|
headerText: 'Rekomendasi video'
|
|
1608
1442
|
})
|
|
1609
1443
|
```
|
|
1610
1444
|
|
|
1611
|
-
**Field tiap reel:**
|
|
1612
|
-
|
|
1613
1445
|
| Field | Tipe | Keterangan |
|
|
1614
1446
|
|-------|------|------------|
|
|
1615
1447
|
| `username` / `title` | string | Nama kreator |
|
|
@@ -1619,7 +1451,6 @@ await sock.sendMessage(jid, {
|
|
|
1619
1451
|
| `reels_title` | string | Judul reel |
|
|
1620
1452
|
| `likes_count` / `like` | number | Jumlah like |
|
|
1621
1453
|
| `view_count` / `view` | number | Jumlah views |
|
|
1622
|
-
| `shares_count` / `share` | number | Jumlah share |
|
|
1623
1454
|
| `reel_source` / `source` | string | `'IG'`, `'TT'`, dll |
|
|
1624
1455
|
| `is_verified` / `verified` | boolean | Akun terverifikasi |
|
|
1625
1456
|
|
|
@@ -1627,8 +1458,6 @@ await sock.sendMessage(jid, {
|
|
|
1627
1458
|
|
|
1628
1459
|
### 🛍️ addProduct
|
|
1629
1460
|
|
|
1630
|
-
Kirim kartu produk (single atau horizontal scroll untuk banyak produk).
|
|
1631
|
-
|
|
1632
1461
|
```js
|
|
1633
1462
|
// Satu produk (Single layout)
|
|
1634
1463
|
await sock.sendMessage(jid, {
|
|
@@ -1638,8 +1467,7 @@ await sock.sendMessage(jid, {
|
|
|
1638
1467
|
price: 'Rp 150.000',
|
|
1639
1468
|
sale_price: 'Rp 120.000',
|
|
1640
1469
|
product_url: 'https://toko.example.com/produk',
|
|
1641
|
-
image_url: 'https://example.com/produk.jpg'
|
|
1642
|
-
icon_url: 'https://example.com/icon.jpg'
|
|
1470
|
+
image_url: 'https://example.com/produk.jpg'
|
|
1643
1471
|
},
|
|
1644
1472
|
headerText: 'Rekomendasi produk untukmu'
|
|
1645
1473
|
})
|
|
@@ -1649,14 +1477,12 @@ await sock.sendMessage(jid, {
|
|
|
1649
1477
|
richProduct: [
|
|
1650
1478
|
{
|
|
1651
1479
|
title: 'Produk A',
|
|
1652
|
-
brand: 'Brand X',
|
|
1653
1480
|
price: 'Rp 50.000',
|
|
1654
1481
|
product_url: 'https://toko.example.com/a',
|
|
1655
1482
|
image_url: 'https://example.com/a.jpg'
|
|
1656
1483
|
},
|
|
1657
1484
|
{
|
|
1658
1485
|
title: 'Produk B',
|
|
1659
|
-
brand: 'Brand Y',
|
|
1660
1486
|
price: 'Rp 75.000',
|
|
1661
1487
|
sale_price: 'Rp 60.000',
|
|
1662
1488
|
product_url: 'https://toko.example.com/b',
|
|
@@ -1667,46 +1493,25 @@ await sock.sendMessage(jid, {
|
|
|
1667
1493
|
})
|
|
1668
1494
|
```
|
|
1669
1495
|
|
|
1670
|
-
**
|
|
1671
|
-
|
|
1672
|
-
| Field | Tipe | Keterangan |
|
|
1673
|
-
|-------|------|------------|
|
|
1674
|
-
| `title` | string | Nama produk |
|
|
1675
|
-
| `brand` | string | Nama brand |
|
|
1676
|
-
| `price` | string | Harga normal (teks bebas, mis. `'Rp 50.000'`) |
|
|
1677
|
-
| `sale_price` / `salePrice` | string | Harga diskon |
|
|
1678
|
-
| `product_url` / `url` | string | Link produk |
|
|
1679
|
-
| `image_url` / `image` | string | URL gambar utama |
|
|
1680
|
-
| `icon_url` / `icon` | string | URL gambar tambahan |
|
|
1681
|
-
|
|
1682
|
-
> Kirim object tunggal → **Single layout**. Kirim array → **HScroll layout**.
|
|
1496
|
+
> Object tunggal → **Single layout** · Array → **HScroll layout**
|
|
1683
1497
|
|
|
1684
1498
|
---
|
|
1685
1499
|
|
|
1686
1500
|
### 📝 addPost
|
|
1687
1501
|
|
|
1688
|
-
Kirim kartu post sosial media (Instagram, TikTok, dll) dalam horizontal scroll.
|
|
1689
|
-
|
|
1690
1502
|
```js
|
|
1691
1503
|
// Satu post
|
|
1692
1504
|
await sock.sendMessage(jid, {
|
|
1693
1505
|
richPost: {
|
|
1694
|
-
title: 'Judul Post',
|
|
1695
|
-
subtitle: 'Subjudul',
|
|
1696
1506
|
username: 'namauser',
|
|
1697
1507
|
profile_picture_url: 'https://example.com/avatar.jpg',
|
|
1698
1508
|
is_verified: true,
|
|
1699
1509
|
thumbnail_url: 'https://example.com/thumb.jpg',
|
|
1700
1510
|
post_caption: 'Caption post ini',
|
|
1701
1511
|
likes_count: 5000,
|
|
1702
|
-
comments_count: 200,
|
|
1703
|
-
shares_count: 100,
|
|
1704
1512
|
post_url: 'https://instagram.com/p/xxx',
|
|
1705
|
-
post_deeplink: 'instagram://post/xxx',
|
|
1706
1513
|
source_app: 'INSTAGRAM',
|
|
1707
|
-
|
|
1708
|
-
orientation: 'LANDSCAPE', // 'LANDSCAPE' | 'PORTRAIT'
|
|
1709
|
-
post_type: 'VIDEO' // 'VIDEO' | 'IMAGE'
|
|
1514
|
+
orientation: 'LANDSCAPE'
|
|
1710
1515
|
},
|
|
1711
1516
|
headerText: 'Post terpopuler'
|
|
1712
1517
|
})
|
|
@@ -1717,7 +1522,6 @@ await sock.sendMessage(jid, {
|
|
|
1717
1522
|
{
|
|
1718
1523
|
username: 'user1',
|
|
1719
1524
|
thumbnail_url: 'https://example.com/thumb1.jpg',
|
|
1720
|
-
post_caption: 'Caption post pertama',
|
|
1721
1525
|
likes_count: 3000,
|
|
1722
1526
|
post_url: 'https://instagram.com/p/aaa',
|
|
1723
1527
|
source_app: 'INSTAGRAM'
|
|
@@ -1725,7 +1529,6 @@ await sock.sendMessage(jid, {
|
|
|
1725
1529
|
{
|
|
1726
1530
|
username: 'user2',
|
|
1727
1531
|
thumbnail_url: 'https://example.com/thumb2.jpg',
|
|
1728
|
-
post_caption: 'Caption post kedua',
|
|
1729
1532
|
likes_count: 1500,
|
|
1730
1533
|
post_url: 'https://tiktok.com/@user2/video/yyy',
|
|
1731
1534
|
source_app: 'TIKTOK'
|
|
@@ -1735,61 +1538,23 @@ await sock.sendMessage(jid, {
|
|
|
1735
1538
|
})
|
|
1736
1539
|
```
|
|
1737
1540
|
|
|
1738
|
-
**Field tiap post:**
|
|
1739
|
-
|
|
1740
|
-
| Field | Tipe | Keterangan |
|
|
1741
|
-
|-------|------|------------|
|
|
1742
|
-
| `title` | string | Judul post |
|
|
1743
|
-
| `subtitle` | string | Subjudul |
|
|
1744
|
-
| `username` | string | Nama pengguna |
|
|
1745
|
-
| `profile_picture_url` / `profile_url` | string | URL foto profil |
|
|
1746
|
-
| `is_verified` / `verified` | boolean | Akun terverifikasi |
|
|
1747
|
-
| `thumbnail_url` / `thumbnail` | string | URL thumbnail post |
|
|
1748
|
-
| `post_caption` / `caption` | string | Caption/teks post |
|
|
1749
|
-
| `likes_count` / `like` | number | Jumlah like |
|
|
1750
|
-
| `comments_count` / `comment` | number | Jumlah komentar |
|
|
1751
|
-
| `shares_count` / `share` | number | Jumlah share |
|
|
1752
|
-
| `post_url` / `url` | string | URL post |
|
|
1753
|
-
| `post_deeplink` / `deeplink` | string | Deeplink aplikasi |
|
|
1754
|
-
| `source_app` / `source` | string | `'INSTAGRAM'`, `'TIKTOK'`, dll |
|
|
1755
|
-
| `footer_label` / `footer` | string | Teks footer |
|
|
1756
|
-
| `footer_icon` / `icon` | string | URL ikon footer |
|
|
1757
|
-
| `orientation` | string | `'LANDSCAPE'` atau `'PORTRAIT'` |
|
|
1758
|
-
| `post_type` | string | `'VIDEO'` atau `'IMAGE'` |
|
|
1759
|
-
|
|
1760
1541
|
---
|
|
1761
1542
|
|
|
1762
1543
|
### 💡 addTip
|
|
1763
1544
|
|
|
1764
|
-
Kirim teks pendek sebagai metadata/tip (tampil lebih kecil dan subtle).
|
|
1765
|
-
|
|
1766
1545
|
```js
|
|
1767
1546
|
await sock.sendMessage(jid, {
|
|
1768
1547
|
tip: 'Informasi ini dibuat oleh AI berdasarkan data terbaru.',
|
|
1769
1548
|
headerText: 'Ringkasan'
|
|
1770
1549
|
})
|
|
1771
|
-
|
|
1772
|
-
// Dikombinasikan dengan tipe lain
|
|
1773
|
-
await sock.sendMessage(jid, {
|
|
1774
|
-
contentText: 'Berikut jawabannya...',
|
|
1775
|
-
tip: 'Jawaban mungkin tidak selalu akurat. Verifikasi mandiri disarankan.'
|
|
1776
|
-
})
|
|
1777
1550
|
```
|
|
1778
1551
|
|
|
1779
1552
|
---
|
|
1780
1553
|
|
|
1781
1554
|
### 🔮 addSuggest
|
|
1782
1555
|
|
|
1783
|
-
Kirim saran prompt follow-up sebagai pill buttons yang bisa langsung diklik user.
|
|
1784
|
-
|
|
1785
1556
|
```js
|
|
1786
|
-
//
|
|
1787
|
-
await sock.sendMessage(jid, {
|
|
1788
|
-
contentText: 'Begitulah penjelasannya.',
|
|
1789
|
-
suggest: 'Jelaskan lebih detail'
|
|
1790
|
-
})
|
|
1791
|
-
|
|
1792
|
-
// Beberapa saran
|
|
1557
|
+
// Beberapa saran (tampil sebagai pill button)
|
|
1793
1558
|
await sock.sendMessage(jid, {
|
|
1794
1559
|
contentText: 'Apakah ada yang ingin kamu tanyakan?',
|
|
1795
1560
|
suggest: [
|
|
@@ -1801,91 +1566,11 @@ await sock.sendMessage(jid, {
|
|
|
1801
1566
|
})
|
|
1802
1567
|
```
|
|
1803
1568
|
|
|
1804
|
-
> Saran tampil sebagai pill button di bawah pesan. Saat user mengetuk salah satu, teks saran tersebut akan terkirim sebagai pesan baru.
|
|
1805
|
-
|
|
1806
|
-
---
|
|
1807
|
-
|
|
1808
|
-
### 🖼️ Grid Image (Rich)
|
|
1809
|
-
|
|
1810
|
-
Kirim grid gambar dengan format verbose (object URL lengkap).
|
|
1811
|
-
|
|
1812
|
-
> Untuk pemakaian praktis, gunakan shorthand [`image`](#addimage).
|
|
1813
|
-
|
|
1814
|
-
```js
|
|
1815
|
-
// Object URL lengkap (recommended untuk kontrol penuh)
|
|
1816
|
-
await sock.sendMessage(jid, {
|
|
1817
|
-
gridImage: {
|
|
1818
|
-
gridImageUrl: {
|
|
1819
|
-
imagePreviewUrl: 'https://picsum.photos/id/10/300/300',
|
|
1820
|
-
imageHighResUrl: 'https://picsum.photos/id/10/1200/1200',
|
|
1821
|
-
sourceUrl: 'https://picsum.photos'
|
|
1822
|
-
},
|
|
1823
|
-
imageUrls: [
|
|
1824
|
-
{
|
|
1825
|
-
imagePreviewUrl: 'https://picsum.photos/id/11/300/300',
|
|
1826
|
-
imageHighResUrl: 'https://picsum.photos/id/11/1200/1200',
|
|
1827
|
-
sourceUrl: 'https://picsum.photos'
|
|
1828
|
-
}
|
|
1829
|
-
]
|
|
1830
|
-
},
|
|
1831
|
-
headerText: 'Hasil pencarian gambar'
|
|
1832
|
-
})
|
|
1833
|
-
|
|
1834
|
-
// String URL (shorthand)
|
|
1835
|
-
await sock.sendMessage(jid, {
|
|
1836
|
-
gridImage: {
|
|
1837
|
-
gridImageUrl: 'https://picsum.photos/id/10/300/300',
|
|
1838
|
-
imageUrls: ['https://picsum.photos/id/11/300/300']
|
|
1839
|
-
},
|
|
1840
|
-
headerText: 'Hasil pencarian gambar'
|
|
1841
|
-
})
|
|
1842
|
-
```
|
|
1843
|
-
|
|
1844
|
-
---
|
|
1845
|
-
|
|
1846
|
-
### 📸 Inline Image (Rich)
|
|
1847
|
-
|
|
1848
|
-
Kirim gambar yang muncul inline di dalam teks.
|
|
1849
|
-
|
|
1850
|
-
```js
|
|
1851
|
-
await sock.sendMessage(jid, {
|
|
1852
|
-
inlineImage: {
|
|
1853
|
-
imageUrl: 'https://picsum.photos/id/237/300/300',
|
|
1854
|
-
imageText: 'Ilustrasi gambar',
|
|
1855
|
-
alignment: 2, // 0 = leading, 1 = trailing, 2 = center
|
|
1856
|
-
tapLinkUrl: 'https://picsum.photos'
|
|
1857
|
-
},
|
|
1858
|
-
headerText: 'Berikut ilustrasinya',
|
|
1859
|
-
footerText: 'Tap gambar untuk detail'
|
|
1860
|
-
})
|
|
1861
|
-
```
|
|
1862
|
-
|
|
1863
|
-
---
|
|
1864
|
-
|
|
1865
|
-
### 🎞️ Dynamic / GIF (Rich)
|
|
1866
|
-
|
|
1867
|
-
Kirim animasi atau GIF.
|
|
1868
|
-
|
|
1869
|
-
```js
|
|
1870
|
-
await sock.sendMessage(jid, {
|
|
1871
|
-
dynamic: {
|
|
1872
|
-
url: 'https://example.com/animation.gif',
|
|
1873
|
-
type: 2, // 1 = IMAGE, 2 = GIF
|
|
1874
|
-
version: 1,
|
|
1875
|
-
loopCount: 0 // 0 = loop selamanya
|
|
1876
|
-
},
|
|
1877
|
-
headerText: 'Animasi untuk kamu'
|
|
1878
|
-
})
|
|
1879
|
-
```
|
|
1880
|
-
|
|
1881
1569
|
---
|
|
1882
1570
|
|
|
1883
1571
|
### 🗺️ Map (Rich)
|
|
1884
1572
|
|
|
1885
|
-
Kirim peta interaktif dengan anotasi lokasi.
|
|
1886
|
-
|
|
1887
1573
|
```js
|
|
1888
|
-
// Satu lokasi
|
|
1889
1574
|
await sock.sendMessage(jid, {
|
|
1890
1575
|
map: {
|
|
1891
1576
|
centerLatitude: -6.2088,
|
|
@@ -1905,46 +1590,15 @@ await sock.sendMessage(jid, {
|
|
|
1905
1590
|
},
|
|
1906
1591
|
headerText: 'Lokasi yang kamu cari'
|
|
1907
1592
|
})
|
|
1908
|
-
|
|
1909
|
-
// Multi-lokasi
|
|
1910
|
-
await sock.sendMessage(jid, {
|
|
1911
|
-
map: {
|
|
1912
|
-
centerLatitude: -7.2575,
|
|
1913
|
-
centerLongitude: 112.7521,
|
|
1914
|
-
latitudeDelta: 0.1,
|
|
1915
|
-
longitudeDelta: 0.1,
|
|
1916
|
-
showInfoList: true,
|
|
1917
|
-
annotations: [
|
|
1918
|
-
{ number: 1, latitude: -7.2575, longitude: 112.7521, title: 'Surabaya', body: 'Kota Pahlawan' },
|
|
1919
|
-
{ number: 2, latitude: -7.9797, longitude: 112.6304, title: 'Malang', body: 'Kota Bunga' }
|
|
1920
|
-
]
|
|
1921
|
-
},
|
|
1922
|
-
headerText: 'Kota-kota di Jawa Timur'
|
|
1923
|
-
})
|
|
1924
1593
|
```
|
|
1925
1594
|
|
|
1926
1595
|
---
|
|
1927
1596
|
|
|
1928
1597
|
### 🧮 LaTeX (Rich)
|
|
1929
1598
|
|
|
1930
|
-
Kirim rumus matematika dalam format LaTeX.
|
|
1931
|
-
|
|
1932
1599
|
> `url` di setiap expression akan **otomatis di-generate** dari [latex.codecogs.com](https://latex.codecogs.com) jika tidak diisi.
|
|
1933
1600
|
|
|
1934
1601
|
```js
|
|
1935
|
-
// Satu rumus
|
|
1936
|
-
await sock.sendMessage(jid, {
|
|
1937
|
-
latex: {
|
|
1938
|
-
text: 'Berikut rumus yang kamu minta:',
|
|
1939
|
-
expressions: [
|
|
1940
|
-
{ expression: 'E = mc^2', width: 120, height: 40 }
|
|
1941
|
-
]
|
|
1942
|
-
},
|
|
1943
|
-
headerText: 'Rumus Einstein',
|
|
1944
|
-
footerText: 'E = energi, m = massa, c = kecepatan cahaya'
|
|
1945
|
-
})
|
|
1946
|
-
|
|
1947
|
-
// Beberapa rumus
|
|
1948
1602
|
await sock.sendMessage(jid, {
|
|
1949
1603
|
latex: {
|
|
1950
1604
|
text: 'Rumus-rumus fisika dasar:',
|
|
@@ -1954,86 +1608,60 @@ await sock.sendMessage(jid, {
|
|
|
1954
1608
|
{ expression: 's = ut + \\frac{1}{2}at^2', width: 160, height: 50 }
|
|
1955
1609
|
]
|
|
1956
1610
|
},
|
|
1957
|
-
headerText: 'Hukum Newton'
|
|
1958
|
-
disclaimerText: 'Fisika dasar kelas 10'
|
|
1611
|
+
headerText: 'Hukum Newton'
|
|
1959
1612
|
})
|
|
1960
1613
|
```
|
|
1961
1614
|
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
1615
|
---
|
|
1965
1616
|
|
|
1966
|
-
###
|
|
1967
|
-
|
|
1968
|
-
Fungsi standalone kompatibel dengan upstream baileys. Bisa dipanggil langsung dari socket:
|
|
1617
|
+
### 🖼️ Grid Image (Rich)
|
|
1969
1618
|
|
|
1970
1619
|
```js
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
{ latexExpression: 'a^2 + b^2 = c^2', width: 150, height: 45 }
|
|
1978
|
-
],
|
|
1979
|
-
headerText: 'Matematika',
|
|
1980
|
-
footer: 'Semoga paham!'
|
|
1620
|
+
await sock.sendMessage(jid, {
|
|
1621
|
+
gridImage: {
|
|
1622
|
+
gridImageUrl: 'https://picsum.photos/id/10/300/300',
|
|
1623
|
+
imageUrls: ['https://picsum.photos/id/11/300/300']
|
|
1624
|
+
},
|
|
1625
|
+
headerText: 'Hasil pencarian gambar'
|
|
1981
1626
|
})
|
|
1982
|
-
|
|
1983
|
-
// sendLatexImage — render ke PNG dulu, lalu upload
|
|
1984
|
-
await sock.sendLatexImage(jid, m, {
|
|
1985
|
-
expressions: [{ latexExpression: 'E = mc^2' }]
|
|
1986
|
-
}, renderLatexToPng, sock.waUploadToServer)
|
|
1987
|
-
|
|
1988
|
-
// sendLatexInlineImage — render ke PNG, kirim sebagai InlineImage per expression
|
|
1989
|
-
await sock.sendLatexInlineImage(jid, m, {
|
|
1990
|
-
expressions: [{ latexExpression: '\\int_0^\\infty e^{-x} dx = 1' }]
|
|
1991
|
-
}, renderLatexToPng, sock.waUploadToServer)
|
|
1992
1627
|
```
|
|
1993
1628
|
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
```js
|
|
1997
|
-
// sendTable — format V1
|
|
1998
|
-
await sock.sendTable(jid, 'Data Kota', ['Kota', 'Populasi'], [['Jakarta', '10jt'], ['Surabaya', '3jt']], m)
|
|
1999
|
-
|
|
2000
|
-
// sendList
|
|
2001
|
-
await sock.sendList(jid, 'Daftar Belanja', ['Apel', 'Jeruk', 'Mangga'], m)
|
|
2002
|
-
```
|
|
1629
|
+
---
|
|
2003
1630
|
|
|
2004
|
-
###
|
|
1631
|
+
### 📸 Inline Image (Rich)
|
|
2005
1632
|
|
|
2006
1633
|
```js
|
|
2007
|
-
await sock.
|
|
1634
|
+
await sock.sendMessage(jid, {
|
|
1635
|
+
inlineImage: {
|
|
1636
|
+
imageUrl: 'https://picsum.photos/id/237/300/300',
|
|
1637
|
+
imageText: 'Ilustrasi gambar',
|
|
1638
|
+
alignment: 2, // 0 = leading, 1 = trailing, 2 = center
|
|
1639
|
+
tapLinkUrl: 'https://picsum.photos'
|
|
1640
|
+
},
|
|
1641
|
+
headerText: 'Berikut ilustrasinya'
|
|
1642
|
+
})
|
|
2008
1643
|
```
|
|
2009
1644
|
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
```js
|
|
2013
|
-
await sock.sendLink(jid, 'Kunjungi dokumentasi ini', [{ url: 'https://docs.example.com', displayName: 'Docs' }], m)
|
|
2014
|
-
```
|
|
1645
|
+
---
|
|
2015
1646
|
|
|
2016
|
-
###
|
|
1647
|
+
### 🎞️ Dynamic / GIF (Rich)
|
|
2017
1648
|
|
|
2018
1649
|
```js
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
1650
|
+
await sock.sendMessage(jid, {
|
|
1651
|
+
dynamic: {
|
|
1652
|
+
url: 'https://example.com/animation.gif',
|
|
1653
|
+
type: 2, // 1 = IMAGE, 2 = GIF
|
|
1654
|
+
version: 1,
|
|
1655
|
+
loopCount: 0 // 0 = loop selamanya
|
|
1656
|
+
},
|
|
1657
|
+
headerText: 'Animasi untuk kamu'
|
|
1658
|
+
})
|
|
2028
1659
|
```
|
|
1660
|
+
|
|
2029
1661
|
---
|
|
2030
1662
|
|
|
2031
1663
|
### 📦 Content Items (Rich)
|
|
2032
1664
|
|
|
2033
|
-
Kirim carousel konten (reel/video) dengan format verbose.
|
|
2034
|
-
|
|
2035
|
-
> Untuk pemakaian praktis, gunakan shorthand [`reels`](#addreels).
|
|
2036
|
-
|
|
2037
1665
|
```js
|
|
2038
1666
|
await sock.sendMessage(jid, {
|
|
2039
1667
|
contentItems: {
|
|
@@ -2045,13 +1673,6 @@ await sock.sendMessage(jid, {
|
|
|
2045
1673
|
profileIconUrl: 'https://example.com/avatar1.jpg',
|
|
2046
1674
|
thumbnailUrl: 'https://example.com/thumb1.jpg',
|
|
2047
1675
|
videoUrl: 'https://example.com/video1.mp4'
|
|
2048
|
-
},
|
|
2049
|
-
{
|
|
2050
|
-
kind: 'reel',
|
|
2051
|
-
title: 'Belajar React Hooks',
|
|
2052
|
-
profileIconUrl: 'https://example.com/avatar2.jpg',
|
|
2053
|
-
thumbnailUrl: 'https://example.com/thumb2.jpg',
|
|
2054
|
-
videoUrl: 'https://example.com/video2.mp4'
|
|
2055
1676
|
}
|
|
2056
1677
|
]
|
|
2057
1678
|
},
|
|
@@ -2061,40 +1682,9 @@ await sock.sendMessage(jid, {
|
|
|
2061
1682
|
|
|
2062
1683
|
---
|
|
2063
1684
|
|
|
2064
|
-
### 🔗 Links (Rich)
|
|
2065
|
-
|
|
2066
|
-
Kirim teks dengan inline citation/reference link.
|
|
2067
|
-
|
|
2068
|
-
```js
|
|
2069
|
-
await sock.sendMessage(jid, {
|
|
2070
|
-
links: [
|
|
2071
|
-
{
|
|
2072
|
-
text: 'Kunjungi dokumentasi',
|
|
2073
|
-
title: 'Docs',
|
|
2074
|
-
displayName: 'Baileys Docs',
|
|
2075
|
-
url: 'https://example.com/docs',
|
|
2076
|
-
sources: [
|
|
2077
|
-
{
|
|
2078
|
-
displayName: 'Source 1',
|
|
2079
|
-
subtitle: 'Sumber terpercaya',
|
|
2080
|
-
url: 'https://example.com/source'
|
|
2081
|
-
}
|
|
2082
|
-
]
|
|
2083
|
-
}
|
|
2084
|
-
],
|
|
2085
|
-
headerText: 'Referensi',
|
|
2086
|
-
footerText: 'Semoga berguna'
|
|
2087
|
-
})
|
|
2088
|
-
```
|
|
2089
|
-
|
|
2090
|
-
---
|
|
2091
|
-
|
|
2092
1685
|
### 🎁 Rich Response (Gabungan)
|
|
2093
1686
|
|
|
2094
|
-
Kirim kombinasi berbagai tipe Rich Message dalam satu pesan menggunakan mode array.
|
|
2095
|
-
|
|
2096
1687
|
```js
|
|
2097
|
-
// Kombinasi teks + kode + tabel
|
|
2098
1688
|
await sock.sendMessage(jid, {
|
|
2099
1689
|
richResponse: [
|
|
2100
1690
|
{ text: 'Penjelasan singkat:' },
|
|
@@ -2103,42 +1693,18 @@ await sock.sendMessage(jid, {
|
|
|
2103
1693
|
table: [['Kolom A', 'Kolom B'], ['Nilai 1', 'Nilai 2']],
|
|
2104
1694
|
title: 'Hasil'
|
|
2105
1695
|
},
|
|
2106
|
-
{ text: 'Semoga membantu ya!' }
|
|
2107
|
-
],
|
|
2108
|
-
disclaimerText: 'Generated by AI'
|
|
2109
|
-
})
|
|
2110
|
-
|
|
2111
|
-
// Kombinasi dengan semua tipe baru
|
|
2112
|
-
await sock.sendMessage(jid, {
|
|
2113
|
-
richResponse: [
|
|
2114
|
-
{ text: 'Berikut hasilnya:' },
|
|
2115
1696
|
{ richImage: ['https://example.com/img1.jpg', 'https://example.com/img2.jpg'] },
|
|
2116
1697
|
{ source: [{ url: 'https://example.com', title: 'Sumber Data' }] },
|
|
2117
|
-
{ code: 'print("Hello")', language: 'python' },
|
|
2118
|
-
{
|
|
2119
|
-
product: [
|
|
2120
|
-
{ title: 'Produk A', price: 'Rp 50.000', image_url: 'https://example.com/a.jpg', product_url: 'https://example.com/a' },
|
|
2121
|
-
{ title: 'Produk B', price: 'Rp 75.000', image_url: 'https://example.com/b.jpg', product_url: 'https://example.com/b' }
|
|
2122
|
-
]
|
|
2123
|
-
},
|
|
2124
|
-
{
|
|
2125
|
-
post: [
|
|
2126
|
-
{ username: 'user1', thumbnail_url: 'https://example.com/t1.jpg', post_url: 'https://ig.com/p/aaa', source_app: 'INSTAGRAM', likes_count: 1000 }
|
|
2127
|
-
]
|
|
2128
|
-
},
|
|
2129
1698
|
{ tip: 'Informasi ini dihasilkan secara otomatis.' },
|
|
2130
|
-
{ suggest: ['Tanya lebih lanjut', 'Lihat contoh lain'
|
|
1699
|
+
{ suggest: ['Tanya lebih lanjut', 'Lihat contoh lain'] }
|
|
2131
1700
|
],
|
|
2132
|
-
disclaimerText: '
|
|
1701
|
+
disclaimerText: 'Generated by AI'
|
|
2133
1702
|
})
|
|
2134
1703
|
```
|
|
2135
1704
|
|
|
2136
|
-
</details>
|
|
2137
|
-
|
|
2138
1705
|
---
|
|
2139
1706
|
|
|
2140
|
-
|
|
2141
|
-
<summary>📥 Terima & Decode Rich Message</summary>
|
|
1707
|
+
### 📥 Terima & Decode Rich Message
|
|
2142
1708
|
|
|
2143
1709
|
```js
|
|
2144
1710
|
const { normalizeMessageContent, parseRichMessage } = require('@nuiisweety/baileys')
|
|
@@ -2152,33 +1718,15 @@ sock.ev.on('messages.upsert', async ({ messages }) => {
|
|
|
2152
1718
|
|
|
2153
1719
|
for (const sub of parsed.submessages) {
|
|
2154
1720
|
switch (sub.type) {
|
|
2155
|
-
case 'text':
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
case '
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
case '
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
case 'gridImage':
|
|
2165
|
-
console.log('Grid Image:', sub.gridImageUrl, sub.imageUrls)
|
|
2166
|
-
break
|
|
2167
|
-
case 'inlineImage':
|
|
2168
|
-
console.log('Inline Image:', sub.imageUrl, sub.imageText)
|
|
2169
|
-
break
|
|
2170
|
-
case 'dynamic':
|
|
2171
|
-
console.log('Dynamic:', sub.url, sub.dynamicType === 2 ? 'GIF' : 'Image')
|
|
2172
|
-
break
|
|
2173
|
-
case 'map':
|
|
2174
|
-
console.log('Map:', sub.centerLatitude, sub.centerLongitude)
|
|
2175
|
-
break
|
|
2176
|
-
case 'latex':
|
|
2177
|
-
console.log('LaTeX:', sub.text, sub.expressions)
|
|
2178
|
-
break
|
|
2179
|
-
case 'contentItems':
|
|
2180
|
-
console.log('Content Items:', sub.contentType, sub.items)
|
|
2181
|
-
break
|
|
1721
|
+
case 'text': console.log('Teks:', sub.text); break
|
|
1722
|
+
case 'code': console.log('Kode:', sub.language, sub.raw); break
|
|
1723
|
+
case 'table': console.log('Tabel:', sub.title, sub.rows); break
|
|
1724
|
+
case 'gridImage': console.log('Grid Image:', sub.gridImageUrl); break
|
|
1725
|
+
case 'inlineImage': console.log('Inline Image:', sub.imageUrl); break
|
|
1726
|
+
case 'dynamic': console.log('Dynamic:', sub.url); break
|
|
1727
|
+
case 'map': console.log('Map:', sub.centerLatitude, sub.centerLongitude); break
|
|
1728
|
+
case 'latex': console.log('LaTeX:', sub.expressions); break
|
|
1729
|
+
case 'contentItems': console.log('Content Items:', sub.items); break
|
|
2182
1730
|
}
|
|
2183
1731
|
}
|
|
2184
1732
|
}
|
|
@@ -2187,12 +1735,42 @@ sock.ev.on('messages.upsert', async ({ messages }) => {
|
|
|
2187
1735
|
|
|
2188
1736
|
> `parseRichMessage` menerima `null` atau `undefined` dengan aman — return `null` jika tidak ada rich message.
|
|
2189
1737
|
|
|
2190
|
-
|
|
1738
|
+
---
|
|
1739
|
+
|
|
1740
|
+
### Standalone Functions
|
|
1741
|
+
|
|
1742
|
+
```js
|
|
1743
|
+
// sendLatex
|
|
1744
|
+
await sock.sendLatex(jid, m, {
|
|
1745
|
+
text: 'Rumus Pythagoras:',
|
|
1746
|
+
expressions: [
|
|
1747
|
+
{ latexExpression: 'a^2 + b^2 = c^2', width: 150, height: 45 }
|
|
1748
|
+
],
|
|
1749
|
+
headerText: 'Matematika'
|
|
1750
|
+
})
|
|
1751
|
+
|
|
1752
|
+
// sendTable
|
|
1753
|
+
await sock.sendTable(jid, 'Data Kota', ['Kota', 'Populasi'], [['Jakarta', '10jt'], ['Surabaya', '3jt']], m)
|
|
1754
|
+
|
|
1755
|
+
// sendList
|
|
1756
|
+
await sock.sendList(jid, 'Daftar Belanja', ['Apel', 'Jeruk', 'Mangga'], m)
|
|
1757
|
+
|
|
1758
|
+
// sendCodeBlock
|
|
1759
|
+
await sock.sendCodeBlock(jid, 'console.log("Hello")', m, { language: 'javascript', title: 'Contoh JS' })
|
|
1760
|
+
|
|
1761
|
+
// sendLink
|
|
1762
|
+
await sock.sendLink(jid, 'Kunjungi dokumentasi', [{ url: 'https://docs.example.com', displayName: 'Docs' }], m)
|
|
1763
|
+
|
|
1764
|
+
// sendRichMessage
|
|
1765
|
+
await sock.sendRichMessage(jid, [
|
|
1766
|
+
{ messageType: 2, messageText: 'Teks pertama' },
|
|
1767
|
+
{ messageType: 2, messageText: 'Teks kedua' }
|
|
1768
|
+
], m)
|
|
1769
|
+
```
|
|
2191
1770
|
|
|
2192
1771
|
---
|
|
2193
1772
|
|
|
2194
|
-
|
|
2195
|
-
<summary>📃 List Reply</summary>
|
|
1773
|
+
## 📃 List Reply
|
|
2196
1774
|
|
|
2197
1775
|
```js
|
|
2198
1776
|
await sock.sendMessage(jid, {
|
|
@@ -2204,12 +1782,9 @@ await sock.sendMessage(jid, {
|
|
|
2204
1782
|
})
|
|
2205
1783
|
```
|
|
2206
1784
|
|
|
2207
|
-
</details>
|
|
2208
|
-
|
|
2209
1785
|
---
|
|
2210
1786
|
|
|
2211
|
-
|
|
2212
|
-
<summary>🎴 Sticker Pack</summary>
|
|
1787
|
+
## 🎴 Sticker Pack
|
|
2213
1788
|
|
|
2214
1789
|
```js
|
|
2215
1790
|
await sock.sendMessage(jid, {
|
|
@@ -2232,12 +1807,9 @@ await sock.sendMessage(jid, {
|
|
|
2232
1807
|
})
|
|
2233
1808
|
```
|
|
2234
1809
|
|
|
2235
|
-
</details>
|
|
2236
|
-
|
|
2237
1810
|
---
|
|
2238
1811
|
|
|
2239
|
-
|
|
2240
|
-
<summary>📢 External Ad Reply</summary>
|
|
1812
|
+
## 📢 External Ad Reply
|
|
2241
1813
|
|
|
2242
1814
|
```js
|
|
2243
1815
|
await sock.sendMessage(jid, {
|
|
@@ -2247,18 +1819,15 @@ await sock.sendMessage(jid, {
|
|
|
2247
1819
|
body: 'Deskripsi iklan',
|
|
2248
1820
|
thumbnail: fs.readFileSync('thumbnail.jpg'), // harus Buffer
|
|
2249
1821
|
url: 'https://example.com/produk',
|
|
2250
|
-
mediaType: 1,
|
|
1822
|
+
mediaType: 1,
|
|
2251
1823
|
largeThumbnail: false
|
|
2252
1824
|
}
|
|
2253
1825
|
})
|
|
2254
1826
|
```
|
|
2255
1827
|
|
|
2256
|
-
</details>
|
|
2257
|
-
|
|
2258
1828
|
---
|
|
2259
1829
|
|
|
2260
|
-
|
|
2261
|
-
<summary>💳 Request Payment</summary>
|
|
1830
|
+
## 💳 Request Payment
|
|
2262
1831
|
|
|
2263
1832
|
```js
|
|
2264
1833
|
await sock.sendMessage(jid, {
|
|
@@ -2266,16 +1835,13 @@ await sock.sendMessage(jid, {
|
|
|
2266
1835
|
requestPaymentFrom: '628xxx@s.whatsapp.net',
|
|
2267
1836
|
amount1000: 50000000, // Rp 50.000 (unit 1/1000)
|
|
2268
1837
|
currencyCodeIso4217: 'IDR',
|
|
2269
|
-
expiryTimestamp: Date.now() + 86400000
|
|
1838
|
+
expiryTimestamp: Date.now() + 86400000
|
|
2270
1839
|
})
|
|
2271
1840
|
```
|
|
2272
1841
|
|
|
2273
|
-
</details>
|
|
2274
|
-
|
|
2275
1842
|
---
|
|
2276
1843
|
|
|
2277
|
-
|
|
2278
|
-
<summary>🧾 Invoice</summary>
|
|
1844
|
+
## 🧾 Invoice
|
|
2279
1845
|
|
|
2280
1846
|
```js
|
|
2281
1847
|
// Dengan gambar
|
|
@@ -2293,12 +1859,9 @@ await sock.sendMessage(jid, {
|
|
|
2293
1859
|
})
|
|
2294
1860
|
```
|
|
2295
1861
|
|
|
2296
|
-
</details>
|
|
2297
|
-
|
|
2298
1862
|
---
|
|
2299
1863
|
|
|
2300
|
-
|
|
2301
|
-
<summary>📦 Order</summary>
|
|
1864
|
+
## 📦 Order
|
|
2302
1865
|
|
|
2303
1866
|
```js
|
|
2304
1867
|
await sock.sendMessage(jid, {
|
|
@@ -2312,21 +1875,18 @@ await sock.sendMessage(jid, {
|
|
|
2312
1875
|
orderTitle: 'Pesanan #001',
|
|
2313
1876
|
sellerJid: '628xxx@s.whatsapp.net',
|
|
2314
1877
|
token: 'token_unik',
|
|
2315
|
-
totalAmount1000: 150000000,
|
|
1878
|
+
totalAmount1000: 150000000,
|
|
2316
1879
|
totalCurrencyCode: 'IDR'
|
|
2317
1880
|
}
|
|
2318
1881
|
})
|
|
2319
1882
|
```
|
|
2320
1883
|
|
|
2321
|
-
</details>
|
|
2322
|
-
|
|
2323
1884
|
---
|
|
2324
1885
|
|
|
2325
|
-
|
|
2326
|
-
<summary>💨 Disappearing Messages</summary>
|
|
1886
|
+
## 💨 Disappearing Messages
|
|
2327
1887
|
|
|
2328
1888
|
```js
|
|
2329
|
-
// Aktifkan (86400 detik = 24 jam
|
|
1889
|
+
// Aktifkan (default 86400 detik = 24 jam)
|
|
2330
1890
|
await sock.sendMessage(groupJid, { disappearingMessagesInChat: true })
|
|
2331
1891
|
|
|
2332
1892
|
// Nonaktifkan
|
|
@@ -2338,12 +1898,9 @@ await sock.sendMessage(groupJid, { disappearingMessagesInChat: 604800 }) // 7 h
|
|
|
2338
1898
|
|
|
2339
1899
|
> Hanya berfungsi di grup (`@g.us`).
|
|
2340
1900
|
|
|
2341
|
-
</details>
|
|
2342
|
-
|
|
2343
1901
|
---
|
|
2344
1902
|
|
|
2345
|
-
|
|
2346
|
-
<summary>⚡ Raw Message</summary>
|
|
1903
|
+
## ⚡ Raw Message
|
|
2347
1904
|
|
|
2348
1905
|
```js
|
|
2349
1906
|
await sock.sendMessage(jid, {
|
|
@@ -2358,10 +1915,10 @@ await sock.sendMessage(jid, {
|
|
|
2358
1915
|
|
|
2359
1916
|
---
|
|
2360
1917
|
|
|
2361
|
-
</details>
|
|
2362
|
-
|
|
2363
1918
|
<div align="center">
|
|
2364
1919
|
|
|
1920
|
+
<br/>
|
|
1921
|
+
|
|
2365
1922
|
*Dibuat dengan dedikasi oleh **NuiiS4TORU***
|
|
2366
1923
|
|
|
2367
1924
|
</div>
|