@nuiisweety/baileys 0.1.16 → 0.1.18
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 +522 -829
- package/README.md.bak +390 -833
- package/lib/Socket/index.js +14 -22
- package/lib/Socket/index.js.bak +4 -4
- package/lib/Socket/messages-send.js +12 -3
- package/lib/Socket/messages-send.js.bak +6 -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,111 @@
|
|
|
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
|
-
|
|
7
|
+
<h1>
|
|
8
|
+
<img src="https://readme-typing-svg.demolab.com?font=Fira+Code&size=28&duration=3000&pause=1000&color=F472B6¢er=true&vCenter=true&width=500&lines=%40nuiisweety%2Fbaileys" alt="@nuiisweety/baileys"/>
|
|
9
|
+
</h1>
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
<p>
|
|
12
|
+
Fork dari <a href="https://github.com/WhiskeySockets/Baileys"><b>@whiskeysockets/baileys</b></a> v7.0.0-rc11
|
|
13
|
+
·
|
|
14
|
+
dikembangkan dengan sepenuh hati oleh <b>NuiiS4TORU</b>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p>
|
|
18
|
+
<img src="https://img.shields.io/badge/versi-0.1.18-ff69b4?style=for-the-badge&logo=npm&logoColor=white" alt="version"/>
|
|
19
|
+
<img src="https://img.shields.io/badge/lisensi-MIT-c084fc?style=for-the-badge" alt="license"/>
|
|
20
|
+
<img src="https://img.shields.io/badge/platform-Node.js-22c55e?style=for-the-badge&logo=nodedotjs&logoColor=white" alt="platform"/>
|
|
21
|
+
<img src="https://img.shields.io/badge/WhatsApp-API-25d366?style=for-the-badge&logo=whatsapp&logoColor=white" alt="whatsapp"/>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<br/>
|
|
25
|
+
|
|
26
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" width="100%"/>
|
|
13
27
|
|
|
14
28
|
</div>
|
|
15
29
|
|
|
16
|
-
|
|
30
|
+
<br/>
|
|
31
|
+
|
|
32
|
+
## 📋 Daftar Isi
|
|
33
|
+
|
|
34
|
+
<details open>
|
|
35
|
+
<summary><b>🔌 Koneksi & Setup</b></summary>
|
|
36
|
+
<br/>
|
|
37
|
+
|
|
38
|
+
> [Instalasi](#-instalasi) · [QR Code](#-koneksi-qr-code) · [Pairing Code](#-koneksi-pairing-code) · [Browser Identity](#-browser-identity) · [Opsi Koneksi](#%EF%B8%8F-opsi-koneksi)
|
|
39
|
+
|
|
40
|
+
</details>
|
|
41
|
+
|
|
42
|
+
<details open>
|
|
43
|
+
<summary><b>📨 Handle Pesan</b></summary>
|
|
44
|
+
<br/>
|
|
45
|
+
|
|
46
|
+
> [Terima Pesan](#-terima-pesan) · [Handle Grup](#-handle-grup)
|
|
47
|
+
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
<details open>
|
|
51
|
+
<summary><b>📤 Kirim Pesan</b></summary>
|
|
52
|
+
<br/>
|
|
53
|
+
|
|
54
|
+
> [Teks](#-teks) · [Gambar](#%EF%B8%8F-gambar) · [Video](#-video) · [Audio & Voice Note](#%EF%B8%8F-audio--voice-note) · [Dokumen](#-dokumen) · [Sticker](#-sticker) · [Lokasi](#-lokasi) · [Kontak](#-kontak)
|
|
55
|
+
|
|
56
|
+
</details>
|
|
57
|
+
|
|
58
|
+
<details open>
|
|
59
|
+
<summary><b>💬 Interaksi</b></summary>
|
|
60
|
+
<br/>
|
|
61
|
+
|
|
62
|
+
> [Reaksi](#-reaksi) · [Poll](#-poll) · [Poll Result](#-poll-result) · [Poll Update](#-poll-update) · [Forward](#%EF%B8%8F-forward) · [Hapus Pesan](#%EF%B8%8F-hapus-pesan) · [Edit Pesan](#%EF%B8%8F-edit-pesan) · [Pin Pesan](#-pin-pesan)
|
|
63
|
+
|
|
64
|
+
</details>
|
|
65
|
+
|
|
66
|
+
<details open>
|
|
67
|
+
<summary><b>✨ Fitur Tambahan</b></summary>
|
|
68
|
+
<br/>
|
|
69
|
+
|
|
70
|
+
> [Album](#%EF%B8%8F-album) · [Event](#-event) · [Group Status / Story](#-group-status--group-story) · [Status Mention](#%EF%B8%8F-status-mention) · [Channel (Newsletter)](#-channel-newsletter) · [Flow Reply](#-flow-reply) · [Button Reply](#-button-reply) · [Keep In Chat](#-keep-in-chat) · [Scheduled Call](#-scheduled-call) · [Group Invite](#-group-invite) · [Product](#%EF%B8%8F-product)
|
|
71
|
+
|
|
72
|
+
</details>
|
|
73
|
+
|
|
74
|
+
<details open>
|
|
75
|
+
<summary><b>🎁 Wrapper</b></summary>
|
|
76
|
+
<br/>
|
|
77
|
+
|
|
78
|
+
> [View Once](#%EF%B8%8F-view-once) · [View Once V2](#%EF%B8%8F-view-once-v2) · [Ephemeral](#-ephemeral) · [Spoiler](#-spoiler) · [Group Status Wrap](#-group-status-wrap) · [Lottie Sticker](#%EF%B8%8F-lottie-sticker) · [AI Icon](#-ai-icon) · [Secure Meta Label](#-secure-meta-service-label)
|
|
79
|
+
|
|
80
|
+
</details>
|
|
81
|
+
|
|
82
|
+
<details open>
|
|
83
|
+
<summary><b>🎛️ Interactive</b></summary>
|
|
84
|
+
<br/>
|
|
85
|
+
|
|
86
|
+
> [Buttons Location Header](#-buttons-dengan-location-header) · [Buttons](#%EF%B8%8F-buttons) · [List Message](#-list-message) · [Template Buttons](#%EF%B8%8F-template-buttons) · [Native Flow](#-native-flow) · [Carousel](#-carousel)
|
|
87
|
+
|
|
88
|
+
</details>
|
|
89
|
+
|
|
90
|
+
<details open>
|
|
91
|
+
<summary><b>🔧 Lainnya</b></summary>
|
|
92
|
+
<br/>
|
|
93
|
+
|
|
94
|
+
> [List Reply](#-list-reply) · [Sticker Pack](#-sticker-pack) · [External Ad Reply](#-external-ad-reply) · [Request Payment](#-request-payment) · [Invoice](#-invoice) · [Order](#-order) · [Disappearing Messages](#-disappearing-messages) · [Raw Message](#-raw-message)
|
|
95
|
+
|
|
96
|
+
</details>
|
|
97
|
+
|
|
98
|
+
<details open>
|
|
99
|
+
<summary><b>🤖 Rich Message (AI)</b></summary>
|
|
100
|
+
<br/>
|
|
17
101
|
|
|
18
|
-
|
|
19
|
-
<summary>🗺️ Navigasi</summary>
|
|
20
|
-
|
|
21
|
-
🔌 **Koneksi & Setup** —
|
|
22
|
-
[Instalasi](#instalasi) ·
|
|
23
|
-
[QR Code](#koneksi-qr-code) ·
|
|
24
|
-
[Pairing Code](#koneksi-pairing-code) ·
|
|
25
|
-
[Browser Identity](#browser-identity) ·
|
|
26
|
-
[Opsi Koneksi](#opsi-koneksi)
|
|
27
|
-
|
|
28
|
-
📨 **Handle Pesan** —
|
|
29
|
-
[Terima Pesan](#terima-pesan) ·
|
|
30
|
-
[Handle Grup](#handle-grup)
|
|
31
|
-
|
|
32
|
-
📤 **Kirim Pesan** —
|
|
33
|
-
[Teks](#teks) ·
|
|
34
|
-
[Gambar](#gambar) ·
|
|
35
|
-
[Video](#video) ·
|
|
36
|
-
[Audio & Voice Note](#audio--voice-note) ·
|
|
37
|
-
[Dokumen](#dokumen) ·
|
|
38
|
-
[Sticker](#sticker) ·
|
|
39
|
-
[Lokasi](#lokasi) ·
|
|
40
|
-
[Kontak](#kontak)
|
|
41
|
-
|
|
42
|
-
💬 **Interaksi** —
|
|
43
|
-
[Reaksi](#reaksi) ·
|
|
44
|
-
[Poll](#poll) ·
|
|
45
|
-
[Poll Result](#poll-result) ·
|
|
46
|
-
[Poll Update](#poll-update) ·
|
|
47
|
-
[Forward](#forward) ·
|
|
48
|
-
[Hapus](#hapus-pesan) ·
|
|
49
|
-
[Edit](#edit-pesan) ·
|
|
50
|
-
[Pin](#pin-pesan)
|
|
51
|
-
|
|
52
|
-
✨ **Fitur Tambahan** —
|
|
53
|
-
[Album](#album) ·
|
|
54
|
-
[Event](#event) ·
|
|
55
|
-
[Group Status / Story](#group-status--group-story) ·
|
|
56
|
-
[Status Mention](#status-mention) ·
|
|
57
|
-
[Flow Reply](#flow-reply) ·
|
|
58
|
-
[Button Reply](#button-reply) ·
|
|
59
|
-
[Keep In Chat](#keep-in-chat) ·
|
|
60
|
-
[Scheduled Call](#scheduled-call) ·
|
|
61
|
-
[Group Invite](#group-invite) ·
|
|
62
|
-
[Product](#product)
|
|
63
|
-
|
|
64
|
-
🎁 **Wrapper** —
|
|
65
|
-
[View Once](#view-once) ·
|
|
66
|
-
[View Once V2](#view-once-v2) ·
|
|
67
|
-
[Ephemeral](#ephemeral) ·
|
|
68
|
-
[Spoiler](#spoiler) ·
|
|
69
|
-
[Group Status Wrap](#group-status-wrap) ·
|
|
70
|
-
[Lottie Sticker](#lottie-sticker) ·
|
|
71
|
-
[AI Icon](#ai-icon) ·
|
|
72
|
-
[Secure Meta Label](#secure-meta-service-label)
|
|
73
|
-
|
|
74
|
-
🎛️ **Interactive** —
|
|
75
|
-
[Buttons Location Header](#buttons-dengan-location-header-buttonsmessage-langsung) ·
|
|
76
|
-
[Buttons](#buttons) ·
|
|
77
|
-
[List Message](#list-message) ·
|
|
78
|
-
[Template Buttons](#template-buttons) ·
|
|
79
|
-
[Native Flow](#native-flow) ·
|
|
80
|
-
[Carousel](#carousel)
|
|
81
|
-
|
|
82
|
-
🤖 **Rich Message (AI)** —
|
|
83
|
-
[Text](#addtext) ·
|
|
84
|
-
[Code Block](#addcode) ·
|
|
85
|
-
[Table](#addtable) ·
|
|
86
|
-
[Image](#addimage) ·
|
|
87
|
-
[Video](#addvideo) ·
|
|
88
|
-
[Source](#addsource) ·
|
|
89
|
-
[Reels](#addreels) ·
|
|
90
|
-
[Product Card](#addproduct) ·
|
|
91
|
-
[Post](#addpost) ·
|
|
92
|
-
[Tip](#addtip) ·
|
|
93
|
-
[Suggest](#addsuggest) ·
|
|
94
|
-
[Map](#map-rich) ·
|
|
95
|
-
[LaTeX](#latex-rich) ·
|
|
96
|
-
[Grid Image](#grid-image-rich) ·
|
|
97
|
-
[Inline Image](#inline-image-rich) ·
|
|
98
|
-
[Dynamic/GIF](#dynamic--gif-rich) ·
|
|
99
|
-
[Content Items](#content-items-rich) ·
|
|
100
|
-
[Gabungan (richResponse)](#rich-response-gabungan) ·
|
|
101
|
-
[Terima & Decode](#terima--decode-rich-message)
|
|
102
|
-
|
|
103
|
-
🔧 **Lainnya** —
|
|
104
|
-
[List Reply](#list-reply) ·
|
|
105
|
-
[Sticker Pack](#sticker-pack) ·
|
|
106
|
-
[External Ad Reply](#external-ad-reply) ·
|
|
107
|
-
[Request Payment](#request-payment) ·
|
|
108
|
-
[Invoice](#invoice) ·
|
|
109
|
-
[Order](#order) ·
|
|
110
|
-
[Disappearing Messages](#disappearing-messages) ·
|
|
111
|
-
[Raw Message](#raw-message)
|
|
102
|
+
> [addText](#-addtext) · [addCode](#-addcode) · [addTable](#-addtable) · [addImage](#%EF%B8%8F-addimage) · [addVideo](#-addvideo) · [addSource](#-addsource) · [addReels](#-addreels) · [addProduct](#%EF%B8%8F-addproduct) · [addPost](#-addpost) · [addTip](#-addtip) · [addSuggest](#-addsuggest) · [Map](#%EF%B8%8F-map-rich) · [LaTeX](#-latex-rich) · [Grid Image](#%EF%B8%8F-grid-image-rich) · [Inline Image](#-inline-image-rich) · [Dynamic/GIF](#%EF%B8%8F-dynamic--gif-rich) · [Content Items](#-content-items-rich) · [Rich Response](#-rich-response-gabungan) · [Terima & Decode](#-terima--decode-rich-message)
|
|
112
103
|
|
|
113
104
|
</details>
|
|
114
105
|
|
|
106
|
+
<br/>
|
|
115
107
|
---
|
|
116
108
|
|
|
117
|
-
|
|
118
|
-
<summary>📦 Instalasi</summary>
|
|
109
|
+
## 📦 Instalasi
|
|
119
110
|
|
|
120
111
|
```js
|
|
121
112
|
// CommonJS
|
|
@@ -125,12 +116,11 @@ const { default: makeWASocket } = require('@nuiisweety/baileys')
|
|
|
125
116
|
import makeWASocket from '@nuiisweety/baileys'
|
|
126
117
|
```
|
|
127
118
|
|
|
128
|
-
</details>
|
|
129
119
|
|
|
130
|
-
|
|
120
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
131
121
|
|
|
132
|
-
|
|
133
|
-
|
|
122
|
+
|
|
123
|
+
## 📱 Koneksi QR Code
|
|
134
124
|
|
|
135
125
|
```js
|
|
136
126
|
const {
|
|
@@ -163,12 +153,11 @@ async function start() {
|
|
|
163
153
|
start()
|
|
164
154
|
```
|
|
165
155
|
|
|
166
|
-
</details>
|
|
167
156
|
|
|
168
|
-
|
|
157
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
158
|
+
|
|
169
159
|
|
|
170
|
-
|
|
171
|
-
<summary>🔑 Koneksi Pairing Code</summary>
|
|
160
|
+
## 🔑 Koneksi Pairing Code
|
|
172
161
|
|
|
173
162
|
> Cocok untuk server/VPS tanpa tampilan terminal.
|
|
174
163
|
|
|
@@ -192,12 +181,11 @@ if (!sock.authState.creds.registered) {
|
|
|
192
181
|
const code = await sock.requestPairingCode('628123456789', 'NUYY2822')
|
|
193
182
|
```
|
|
194
183
|
|
|
195
|
-
</details>
|
|
196
184
|
|
|
197
|
-
|
|
185
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
198
186
|
|
|
199
|
-
|
|
200
|
-
|
|
187
|
+
|
|
188
|
+
## 🌐 Browser Identity
|
|
201
189
|
|
|
202
190
|
```js
|
|
203
191
|
const { Browsers } = require('@nuiisweety/baileys')
|
|
@@ -212,12 +200,11 @@ makeWASocket({
|
|
|
212
200
|
})
|
|
213
201
|
```
|
|
214
202
|
|
|
215
|
-
</details>
|
|
216
203
|
|
|
217
|
-
|
|
204
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
205
|
+
|
|
218
206
|
|
|
219
|
-
|
|
220
|
-
<summary>⚙️ Opsi Koneksi</summary>
|
|
207
|
+
## ⚙️ Opsi Koneksi
|
|
221
208
|
|
|
222
209
|
```js
|
|
223
210
|
makeWASocket({
|
|
@@ -235,12 +222,11 @@ makeWASocket({
|
|
|
235
222
|
})
|
|
236
223
|
```
|
|
237
224
|
|
|
238
|
-
</details>
|
|
239
225
|
|
|
240
|
-
|
|
226
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
241
227
|
|
|
242
|
-
|
|
243
|
-
|
|
228
|
+
|
|
229
|
+
## 📬 Terima Pesan
|
|
244
230
|
|
|
245
231
|
```js
|
|
246
232
|
sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
@@ -266,12 +252,11 @@ sock.ev.on('messages.upsert', async ({ messages, type }) => {
|
|
|
266
252
|
})
|
|
267
253
|
```
|
|
268
254
|
|
|
269
|
-
</details>
|
|
270
255
|
|
|
271
|
-
|
|
256
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
257
|
+
|
|
272
258
|
|
|
273
|
-
|
|
274
|
-
<summary>👥 Handle Grup</summary>
|
|
259
|
+
## 👥 Handle Grup
|
|
275
260
|
|
|
276
261
|
```js
|
|
277
262
|
// Anggota masuk/keluar
|
|
@@ -312,12 +297,11 @@ await sock.sendMessage(groupJid, {
|
|
|
312
297
|
})
|
|
313
298
|
```
|
|
314
299
|
|
|
315
|
-
</details>
|
|
316
300
|
|
|
317
|
-
|
|
301
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
318
302
|
|
|
319
|
-
|
|
320
|
-
|
|
303
|
+
|
|
304
|
+
## 💬 Teks
|
|
321
305
|
|
|
322
306
|
```js
|
|
323
307
|
await sock.sendMessage(jid, { text: 'Halo!' })
|
|
@@ -329,12 +313,11 @@ await sock.sendMessage(jid, {
|
|
|
329
313
|
}, { quoted: m })
|
|
330
314
|
```
|
|
331
315
|
|
|
332
|
-
</details>
|
|
333
316
|
|
|
334
|
-
|
|
317
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
318
|
+
|
|
335
319
|
|
|
336
|
-
|
|
337
|
-
<summary>🖼️ Gambar</summary>
|
|
320
|
+
## 🖼️ Gambar
|
|
338
321
|
|
|
339
322
|
```js
|
|
340
323
|
// URL
|
|
@@ -350,12 +333,11 @@ await sock.sendMessage(jid, {
|
|
|
350
333
|
})
|
|
351
334
|
```
|
|
352
335
|
|
|
353
|
-
</details>
|
|
354
336
|
|
|
355
|
-
|
|
337
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
356
338
|
|
|
357
|
-
|
|
358
|
-
|
|
339
|
+
|
|
340
|
+
## 🎬 Video
|
|
359
341
|
|
|
360
342
|
```js
|
|
361
343
|
await sock.sendMessage(jid, {
|
|
@@ -371,12 +353,11 @@ await sock.sendMessage(jid, {
|
|
|
371
353
|
})
|
|
372
354
|
```
|
|
373
355
|
|
|
374
|
-
</details>
|
|
375
356
|
|
|
376
|
-
|
|
357
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
358
|
+
|
|
377
359
|
|
|
378
|
-
|
|
379
|
-
<summary>🎙️ Audio & Voice Note</summary>
|
|
360
|
+
## 🎙️ Audio & Voice Note
|
|
380
361
|
|
|
381
362
|
```js
|
|
382
363
|
// Audio biasa
|
|
@@ -393,12 +374,11 @@ await sock.sendMessage(jid, {
|
|
|
393
374
|
})
|
|
394
375
|
```
|
|
395
376
|
|
|
396
|
-
</details>
|
|
397
377
|
|
|
398
|
-
|
|
378
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
399
379
|
|
|
400
|
-
|
|
401
|
-
|
|
380
|
+
|
|
381
|
+
## 📄 Dokumen
|
|
402
382
|
|
|
403
383
|
```js
|
|
404
384
|
await sock.sendMessage(jid, {
|
|
@@ -409,23 +389,21 @@ await sock.sendMessage(jid, {
|
|
|
409
389
|
})
|
|
410
390
|
```
|
|
411
391
|
|
|
412
|
-
</details>
|
|
413
392
|
|
|
414
|
-
|
|
393
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
394
|
+
|
|
415
395
|
|
|
416
|
-
|
|
417
|
-
<summary>🎴 Sticker</summary>
|
|
396
|
+
## 🎴 Sticker
|
|
418
397
|
|
|
419
398
|
```js
|
|
420
399
|
await sock.sendMessage(jid, { sticker: fs.readFileSync('sticker.webp') })
|
|
421
400
|
```
|
|
422
401
|
|
|
423
|
-
</details>
|
|
424
402
|
|
|
425
|
-
|
|
403
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
426
404
|
|
|
427
|
-
|
|
428
|
-
|
|
405
|
+
|
|
406
|
+
## 📍 Lokasi
|
|
429
407
|
|
|
430
408
|
```js
|
|
431
409
|
await sock.sendMessage(jid, {
|
|
@@ -438,12 +416,11 @@ await sock.sendMessage(jid, {
|
|
|
438
416
|
})
|
|
439
417
|
```
|
|
440
418
|
|
|
441
|
-
</details>
|
|
442
419
|
|
|
443
|
-
|
|
420
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
421
|
+
|
|
444
422
|
|
|
445
|
-
|
|
446
|
-
<summary>👤 Kontak</summary>
|
|
423
|
+
## 👤 Kontak
|
|
447
424
|
|
|
448
425
|
```js
|
|
449
426
|
await sock.sendMessage(jid, {
|
|
@@ -456,12 +433,11 @@ await sock.sendMessage(jid, {
|
|
|
456
433
|
})
|
|
457
434
|
```
|
|
458
435
|
|
|
459
|
-
</details>
|
|
460
436
|
|
|
461
|
-
|
|
437
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
462
438
|
|
|
463
|
-
|
|
464
|
-
|
|
439
|
+
|
|
440
|
+
## ❤️ Reaksi
|
|
465
441
|
|
|
466
442
|
```js
|
|
467
443
|
await sock.sendMessage(jid, { react: { text: '❤️', key: m.key } })
|
|
@@ -470,12 +446,11 @@ await sock.sendMessage(jid, { react: { text: '❤️', key: m.key } })
|
|
|
470
446
|
await sock.sendMessage(jid, { react: { text: '', key: m.key } })
|
|
471
447
|
```
|
|
472
448
|
|
|
473
|
-
</details>
|
|
474
449
|
|
|
475
|
-
|
|
450
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
451
|
+
|
|
476
452
|
|
|
477
|
-
|
|
478
|
-
<summary>📊 Poll</summary>
|
|
453
|
+
## 📊 Poll
|
|
479
454
|
|
|
480
455
|
```js
|
|
481
456
|
await sock.sendMessage(jid, {
|
|
@@ -511,12 +486,11 @@ await sock.sendMessage(jid, {
|
|
|
511
486
|
})
|
|
512
487
|
```
|
|
513
488
|
|
|
514
|
-
</details>
|
|
515
489
|
|
|
516
|
-
|
|
490
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
517
491
|
|
|
518
|
-
|
|
519
|
-
|
|
492
|
+
|
|
493
|
+
## 📈 Poll Result
|
|
520
494
|
|
|
521
495
|
```js
|
|
522
496
|
await sock.sendMessage(jid, {
|
|
@@ -531,12 +505,11 @@ await sock.sendMessage(jid, {
|
|
|
531
505
|
})
|
|
532
506
|
```
|
|
533
507
|
|
|
534
|
-
</details>
|
|
535
508
|
|
|
536
|
-
|
|
509
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
510
|
+
|
|
537
511
|
|
|
538
|
-
|
|
539
|
-
<summary>🔄 Poll Update</summary>
|
|
512
|
+
## 🔄 Poll Update
|
|
540
513
|
|
|
541
514
|
```js
|
|
542
515
|
await sock.sendMessage(jid, {
|
|
@@ -548,12 +521,11 @@ await sock.sendMessage(jid, {
|
|
|
548
521
|
})
|
|
549
522
|
```
|
|
550
523
|
|
|
551
|
-
</details>
|
|
552
524
|
|
|
553
|
-
|
|
525
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
554
526
|
|
|
555
|
-
|
|
556
|
-
|
|
527
|
+
|
|
528
|
+
## ↗️ Forward
|
|
557
529
|
|
|
558
530
|
```js
|
|
559
531
|
await sock.sendMessage(jid, {
|
|
@@ -562,23 +534,21 @@ await sock.sendMessage(jid, {
|
|
|
562
534
|
})
|
|
563
535
|
```
|
|
564
536
|
|
|
565
|
-
</details>
|
|
566
537
|
|
|
567
|
-
|
|
538
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
539
|
+
|
|
568
540
|
|
|
569
|
-
|
|
570
|
-
<summary>🗑️ Hapus Pesan</summary>
|
|
541
|
+
## 🗑️ Hapus Pesan
|
|
571
542
|
|
|
572
543
|
```js
|
|
573
544
|
await sock.sendMessage(jid, { delete: m.key })
|
|
574
545
|
```
|
|
575
546
|
|
|
576
|
-
</details>
|
|
577
547
|
|
|
578
|
-
|
|
548
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
579
549
|
|
|
580
|
-
|
|
581
|
-
|
|
550
|
+
|
|
551
|
+
## ✏️ Edit Pesan
|
|
582
552
|
|
|
583
553
|
```js
|
|
584
554
|
await sock.sendMessage(jid, {
|
|
@@ -587,12 +557,11 @@ await sock.sendMessage(jid, {
|
|
|
587
557
|
})
|
|
588
558
|
```
|
|
589
559
|
|
|
590
|
-
</details>
|
|
591
560
|
|
|
592
|
-
|
|
561
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
562
|
+
|
|
593
563
|
|
|
594
|
-
|
|
595
|
-
<summary>📌 Pin Pesan</summary>
|
|
564
|
+
## 📌 Pin Pesan
|
|
596
565
|
|
|
597
566
|
```js
|
|
598
567
|
// Pin
|
|
@@ -606,12 +575,11 @@ await sock.sendMessage(jid, {
|
|
|
606
575
|
await sock.sendMessage(jid, { pin: m.key, type: 2 })
|
|
607
576
|
```
|
|
608
577
|
|
|
609
|
-
</details>
|
|
610
578
|
|
|
611
|
-
|
|
579
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
612
580
|
|
|
613
|
-
|
|
614
|
-
|
|
581
|
+
|
|
582
|
+
## 🗂️ Album
|
|
615
583
|
|
|
616
584
|
```js
|
|
617
585
|
await sock.sendMessage(jid, {
|
|
@@ -624,12 +592,11 @@ await sock.sendMessage(jid, {
|
|
|
624
592
|
// minimal 2 media
|
|
625
593
|
```
|
|
626
594
|
|
|
627
|
-
</details>
|
|
628
595
|
|
|
629
|
-
|
|
596
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
597
|
+
|
|
630
598
|
|
|
631
|
-
|
|
632
|
-
<summary>📅 Event</summary>
|
|
599
|
+
## 📅 Event
|
|
633
600
|
|
|
634
601
|
```js
|
|
635
602
|
await sock.sendMessage(jid, {
|
|
@@ -658,12 +625,11 @@ await sock.sendMessage(jid, {
|
|
|
658
625
|
})
|
|
659
626
|
```
|
|
660
627
|
|
|
661
|
-
</details>
|
|
662
628
|
|
|
663
|
-
|
|
629
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
664
630
|
|
|
665
|
-
|
|
666
|
-
|
|
631
|
+
|
|
632
|
+
## 📖 Group Status / Group Story
|
|
667
633
|
|
|
668
634
|
```js
|
|
669
635
|
// Teks
|
|
@@ -705,14 +671,109 @@ await sock.sendMessage(groupJid, {
|
|
|
705
671
|
})
|
|
706
672
|
```
|
|
707
673
|
|
|
708
|
-
> **Catatan
|
|
674
|
+
> **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"`.
|
|
709
675
|
|
|
710
|
-
</details>
|
|
711
676
|
|
|
712
|
-
|
|
677
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
## 🏷️ Status Mention
|
|
681
|
+
|
|
682
|
+
```js
|
|
683
|
+
// Kirim ke array JID untuk trigger status mention
|
|
684
|
+
await sock.sendMessage(['628xxx@s.whatsapp.net', 'yyy@g.us'], {
|
|
685
|
+
text: 'Hei kamu!',
|
|
686
|
+
backgroundColor: '#ff6b9d'
|
|
687
|
+
})
|
|
688
|
+
|
|
689
|
+
// Gambar dengan mention
|
|
690
|
+
await sock.sendMessage(['628xxx@s.whatsapp.net'], {
|
|
691
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
692
|
+
caption: 'Untuk kamu'
|
|
693
|
+
})
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
> Untuk grup, otomatis pakai `groupStatusMentionMessage`.
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
## 📡 Channel (Newsletter)
|
|
703
|
+
|
|
704
|
+
> **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.
|
|
705
|
+
|
|
706
|
+
> Hanya **admin/owner** channel yang bisa posting. JID channel menggunakan format `@newsletter`.
|
|
707
|
+
|
|
708
|
+
```js
|
|
709
|
+
const channelJid = '120363425154682710@newsletter'
|
|
710
|
+
|
|
711
|
+
// Teks
|
|
712
|
+
await sock.sendMessage(channelJid, { text: 'Halo dari channel!' })
|
|
713
|
+
|
|
714
|
+
// Gambar dari URL
|
|
715
|
+
await sock.sendMessage(channelJid, {
|
|
716
|
+
image: { url: 'https://example.com/image.jpg' },
|
|
717
|
+
caption: 'Keterangan gambar'
|
|
718
|
+
})
|
|
719
|
+
|
|
720
|
+
// Gambar dari file lokal
|
|
721
|
+
await sock.sendMessage(channelJid, {
|
|
722
|
+
image: { url: './gambar.jpg' },
|
|
723
|
+
caption: 'Dari file lokal'
|
|
724
|
+
})
|
|
725
|
+
|
|
726
|
+
// Gambar dari Buffer
|
|
727
|
+
await sock.sendMessage(channelJid, {
|
|
728
|
+
image: fs.readFileSync('gambar.jpg'),
|
|
729
|
+
caption: 'Dari buffer'
|
|
730
|
+
})
|
|
731
|
+
|
|
732
|
+
// Video
|
|
733
|
+
await sock.sendMessage(channelJid, {
|
|
734
|
+
video: { url: 'https://example.com/video.mp4' },
|
|
735
|
+
caption: 'Keterangan video'
|
|
736
|
+
})
|
|
737
|
+
|
|
738
|
+
// Audio
|
|
739
|
+
await sock.sendMessage(channelJid, {
|
|
740
|
+
audio: { url: 'https://example.com/audio.mp3' },
|
|
741
|
+
mimetype: 'audio/mpeg'
|
|
742
|
+
})
|
|
743
|
+
|
|
744
|
+
// Dokumen
|
|
745
|
+
await sock.sendMessage(channelJid, {
|
|
746
|
+
document: { url: 'https://example.com/file.pdf' },
|
|
747
|
+
mimetype: 'application/pdf',
|
|
748
|
+
fileName: 'dokumen.pdf'
|
|
749
|
+
})
|
|
750
|
+
|
|
751
|
+
// Poll
|
|
752
|
+
await sock.sendMessage(channelJid, {
|
|
753
|
+
poll: {
|
|
754
|
+
name: 'Pertanyaan untuk subscriber',
|
|
755
|
+
values: ['Opsi A', 'Opsi B', 'Opsi C'],
|
|
756
|
+
selectableCount: 1
|
|
757
|
+
}
|
|
758
|
+
})
|
|
759
|
+
|
|
760
|
+
// Edit pesan channel
|
|
761
|
+
await sock.sendMessage(channelJid, {
|
|
762
|
+
text: 'Teks yang sudah diedit',
|
|
763
|
+
edit: pesanLama.key
|
|
764
|
+
})
|
|
765
|
+
|
|
766
|
+
// Hapus pesan channel
|
|
767
|
+
await sock.sendMessage(channelJid, { delete: pesanLama.key })
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
> **Catatan:** Channel tidak mendukung enkripsi E2E — media di-upload sebagai file mentah (unencrypted), berbeda dengan chat biasa.
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
774
|
+
|
|
713
775
|
|
|
714
|
-
|
|
715
|
-
<summary>🔁 Flow Reply</summary>
|
|
776
|
+
## 🔁 Flow Reply
|
|
716
777
|
|
|
717
778
|
```js
|
|
718
779
|
await sock.sendMessage(jid, {
|
|
@@ -726,12 +787,11 @@ await sock.sendMessage(jid, {
|
|
|
726
787
|
})
|
|
727
788
|
```
|
|
728
789
|
|
|
729
|
-
</details>
|
|
730
790
|
|
|
731
|
-
|
|
791
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
732
792
|
|
|
733
|
-
|
|
734
|
-
|
|
793
|
+
|
|
794
|
+
## 🔘 Button Reply
|
|
735
795
|
|
|
736
796
|
```js
|
|
737
797
|
// Template button
|
|
@@ -747,12 +807,11 @@ await sock.sendMessage(jid, {
|
|
|
747
807
|
})
|
|
748
808
|
```
|
|
749
809
|
|
|
750
|
-
</details>
|
|
751
810
|
|
|
752
|
-
|
|
811
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
812
|
+
|
|
753
813
|
|
|
754
|
-
|
|
755
|
-
<summary>📎 Keep In Chat</summary>
|
|
814
|
+
## 📎 Keep In Chat
|
|
756
815
|
|
|
757
816
|
```js
|
|
758
817
|
await sock.sendMessage(jid, {
|
|
@@ -761,12 +820,11 @@ await sock.sendMessage(jid, {
|
|
|
761
820
|
})
|
|
762
821
|
```
|
|
763
822
|
|
|
764
|
-
</details>
|
|
765
823
|
|
|
766
|
-
|
|
824
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
767
825
|
|
|
768
|
-
|
|
769
|
-
|
|
826
|
+
|
|
827
|
+
## 📞 Scheduled Call
|
|
770
828
|
|
|
771
829
|
```js
|
|
772
830
|
await sock.sendMessage(jid, {
|
|
@@ -778,12 +836,11 @@ await sock.sendMessage(jid, {
|
|
|
778
836
|
})
|
|
779
837
|
```
|
|
780
838
|
|
|
781
|
-
</details>
|
|
782
839
|
|
|
783
|
-
|
|
840
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
841
|
+
|
|
784
842
|
|
|
785
|
-
|
|
786
|
-
<summary>🔗 Group Invite</summary>
|
|
843
|
+
## 🔗 Group Invite
|
|
787
844
|
|
|
788
845
|
```js
|
|
789
846
|
await sock.sendMessage(jid, {
|
|
@@ -797,12 +854,11 @@ await sock.sendMessage(jid, {
|
|
|
797
854
|
})
|
|
798
855
|
```
|
|
799
856
|
|
|
800
|
-
</details>
|
|
801
857
|
|
|
802
|
-
|
|
858
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
803
859
|
|
|
804
|
-
|
|
805
|
-
|
|
860
|
+
|
|
861
|
+
## 🛍️ Product
|
|
806
862
|
|
|
807
863
|
```js
|
|
808
864
|
await sock.sendMessage(jid, {
|
|
@@ -820,12 +876,11 @@ await sock.sendMessage(jid, {
|
|
|
820
876
|
})
|
|
821
877
|
```
|
|
822
878
|
|
|
823
|
-
</details>
|
|
824
879
|
|
|
825
|
-
|
|
880
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
881
|
+
|
|
826
882
|
|
|
827
|
-
|
|
828
|
-
<summary>👁️ View Once</summary>
|
|
883
|
+
## 👁️ View Once
|
|
829
884
|
|
|
830
885
|
```js
|
|
831
886
|
await sock.sendMessage(jid, {
|
|
@@ -834,12 +889,11 @@ await sock.sendMessage(jid, {
|
|
|
834
889
|
})
|
|
835
890
|
```
|
|
836
891
|
|
|
837
|
-
</details>
|
|
838
892
|
|
|
839
|
-
|
|
893
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
840
894
|
|
|
841
|
-
|
|
842
|
-
|
|
895
|
+
|
|
896
|
+
## 👁️ View Once V2
|
|
843
897
|
|
|
844
898
|
```js
|
|
845
899
|
await sock.sendMessage(jid, {
|
|
@@ -854,12 +908,11 @@ await sock.sendMessage(jid, {
|
|
|
854
908
|
})
|
|
855
909
|
```
|
|
856
910
|
|
|
857
|
-
</details>
|
|
858
911
|
|
|
859
|
-
|
|
912
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
913
|
+
|
|
860
914
|
|
|
861
|
-
|
|
862
|
-
<summary>⏳ Ephemeral</summary>
|
|
915
|
+
## ⏳ Ephemeral
|
|
863
916
|
|
|
864
917
|
```js
|
|
865
918
|
await sock.sendMessage(jid, {
|
|
@@ -868,12 +921,11 @@ await sock.sendMessage(jid, {
|
|
|
868
921
|
})
|
|
869
922
|
```
|
|
870
923
|
|
|
871
|
-
</details>
|
|
872
924
|
|
|
873
|
-
|
|
925
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
874
926
|
|
|
875
|
-
|
|
876
|
-
|
|
927
|
+
|
|
928
|
+
## 🙈 Spoiler
|
|
877
929
|
|
|
878
930
|
```js
|
|
879
931
|
await sock.sendMessage(jid, {
|
|
@@ -883,12 +935,11 @@ await sock.sendMessage(jid, {
|
|
|
883
935
|
})
|
|
884
936
|
```
|
|
885
937
|
|
|
886
|
-
</details>
|
|
887
938
|
|
|
888
|
-
|
|
939
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
940
|
+
|
|
889
941
|
|
|
890
|
-
|
|
891
|
-
<summary>🎭 Group Status Wrap</summary>
|
|
942
|
+
## 🎭 Group Status Wrap
|
|
892
943
|
|
|
893
944
|
Wrapper `groupStatus: true` membungkus pesan apapun ke dalam `groupStatusMessageV2` secara otomatis.
|
|
894
945
|
|
|
@@ -916,12 +967,11 @@ await sock.sendMessage(jid, {
|
|
|
916
967
|
|
|
917
968
|
> **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
969
|
|
|
919
|
-
</details>
|
|
920
970
|
|
|
921
|
-
|
|
971
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
922
972
|
|
|
923
|
-
|
|
924
|
-
|
|
973
|
+
|
|
974
|
+
## 🎞️ Lottie Sticker
|
|
925
975
|
|
|
926
976
|
```js
|
|
927
977
|
await sock.sendMessage(jid, {
|
|
@@ -930,12 +980,11 @@ await sock.sendMessage(jid, {
|
|
|
930
980
|
})
|
|
931
981
|
```
|
|
932
982
|
|
|
933
|
-
</details>
|
|
934
983
|
|
|
935
|
-
|
|
984
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
985
|
+
|
|
936
986
|
|
|
937
|
-
|
|
938
|
-
<summary>🤖 AI Icon</summary>
|
|
987
|
+
## 🤖 AI Icon
|
|
939
988
|
|
|
940
989
|
```js
|
|
941
990
|
// Hanya untuk private chat (bukan grup)
|
|
@@ -948,12 +997,11 @@ await sock.sendMessage(jid, {
|
|
|
948
997
|
})
|
|
949
998
|
```
|
|
950
999
|
|
|
951
|
-
</details>
|
|
952
1000
|
|
|
953
|
-
|
|
1001
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
954
1002
|
|
|
955
|
-
|
|
956
|
-
|
|
1003
|
+
|
|
1004
|
+
## 🔒 Secure Meta Service Label
|
|
957
1005
|
|
|
958
1006
|
```js
|
|
959
1007
|
await sock.sendMessage(jid, {
|
|
@@ -962,12 +1010,11 @@ await sock.sendMessage(jid, {
|
|
|
962
1010
|
})
|
|
963
1011
|
```
|
|
964
1012
|
|
|
965
|
-
</details>
|
|
966
1013
|
|
|
967
|
-
|
|
1014
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1015
|
+
|
|
968
1016
|
|
|
969
|
-
|
|
970
|
-
<summary>📍 Buttons dengan Location Header (buttonsMessage langsung)</summary>
|
|
1017
|
+
## 📍 Buttons dengan Location Header
|
|
971
1018
|
|
|
972
1019
|
Kirim tombol menggunakan `buttonsMessage` secara langsung — berguna untuk header tipe **Location** (`headerType: 6`) yang tidak bisa dibuat lewat shorthand `buttons`.
|
|
973
1020
|
|
|
@@ -991,33 +1038,13 @@ await sock.sendMessage(jid, {
|
|
|
991
1038
|
}
|
|
992
1039
|
})
|
|
993
1040
|
|
|
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
|
|
1041
|
+
// Header kosong (teks saja) — headerType 1
|
|
1015
1042
|
await sock.sendMessage(jid, {
|
|
1016
1043
|
buttonsMessage: {
|
|
1017
1044
|
contentText: 'Pilih opsi',
|
|
1018
1045
|
footerText: 'Bot Footer',
|
|
1019
1046
|
buttons: [
|
|
1020
|
-
{ buttonId: 'yes', buttonText: { displayText: 'Ya' },
|
|
1047
|
+
{ buttonId: 'yes', buttonText: { displayText: 'Ya' }, type: 1 },
|
|
1021
1048
|
{ buttonId: 'no', buttonText: { displayText: 'Tidak' }, type: 1 }
|
|
1022
1049
|
],
|
|
1023
1050
|
headerType: 1
|
|
@@ -1025,23 +1052,23 @@ await sock.sendMessage(jid, {
|
|
|
1025
1052
|
})
|
|
1026
1053
|
```
|
|
1027
1054
|
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1055
|
+
**Nilai `headerType`:**
|
|
1056
|
+
|
|
1057
|
+
| Nilai | Tipe Header |
|
|
1058
|
+
|:-----:|-------------|
|
|
1059
|
+
| `1` | Teks (`contentText`) |
|
|
1060
|
+
| `2` | Gambar (`imageMessage`) |
|
|
1061
|
+
| `3` | Video (`videoMessage`) |
|
|
1062
|
+
| `4` | Dokumen (`documentMessage`) |
|
|
1063
|
+
| `6` | Lokasi (`locationMessage`) |
|
|
1064
|
+
|
|
1037
1065
|
> `jpegThumbnail` pada `locationMessage` bisa berupa **path file lokal**, **URL**, atau **Buffer** — otomatis diproses oleh Baileys.
|
|
1038
1066
|
|
|
1039
|
-
</details>
|
|
1040
1067
|
|
|
1041
|
-
|
|
1068
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1042
1069
|
|
|
1043
|
-
|
|
1044
|
-
|
|
1070
|
+
|
|
1071
|
+
## 🎛️ Buttons
|
|
1045
1072
|
|
|
1046
1073
|
```js
|
|
1047
1074
|
// Teks dengan tombol (quick reply)
|
|
@@ -1066,27 +1093,6 @@ await sock.sendMessage(jid, {
|
|
|
1066
1093
|
]
|
|
1067
1094
|
})
|
|
1068
1095
|
|
|
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
1096
|
// Shorthand: sections langsung di button (otomatis jadi single_select)
|
|
1091
1097
|
await sock.sendMessage(jid, {
|
|
1092
1098
|
text: 'Pilih menu',
|
|
@@ -1103,14 +1109,13 @@ await sock.sendMessage(jid, {
|
|
|
1103
1109
|
})
|
|
1104
1110
|
```
|
|
1105
1111
|
|
|
1106
|
-
> **Field tombol:** gunakan `text` atau `buttonText` untuk label.
|
|
1112
|
+
> **Field tombol:** gunakan `text` atau `buttonText` untuk label. Quick reply pakai `id`/`buttonId`. Native flow pakai `name` + `paramsJson`.
|
|
1107
1113
|
|
|
1108
|
-
</details>
|
|
1109
1114
|
|
|
1110
|
-
|
|
1115
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1116
|
+
|
|
1111
1117
|
|
|
1112
|
-
|
|
1113
|
-
<summary>📋 List Message</summary>
|
|
1118
|
+
## 📋 List Message
|
|
1114
1119
|
|
|
1115
1120
|
```js
|
|
1116
1121
|
await sock.sendMessage(jid, {
|
|
@@ -1136,21 +1141,20 @@ await sock.sendMessage(jid, {
|
|
|
1136
1141
|
})
|
|
1137
1142
|
```
|
|
1138
1143
|
|
|
1139
|
-
> **Trigger key:** `sections
|
|
1144
|
+
> **Trigger key:** `sections`. `listType` otomatis di-set ke `SINGLE_SELECT`. Field `text` di-map ke `description` — gunakan `title` untuk judul list.
|
|
1140
1145
|
|
|
1141
|
-
</details>
|
|
1142
1146
|
|
|
1143
|
-
|
|
1147
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1144
1148
|
|
|
1145
|
-
|
|
1146
|
-
|
|
1149
|
+
|
|
1150
|
+
## 🗃️ Template Buttons
|
|
1147
1151
|
|
|
1148
1152
|
```js
|
|
1149
1153
|
// Teks
|
|
1150
1154
|
await sock.sendMessage(jid, {
|
|
1151
|
-
text: 'Pesan template',
|
|
1152
|
-
footer: 'Footer',
|
|
1153
|
-
id: 'template-unik',
|
|
1155
|
+
text: 'Pesan template',
|
|
1156
|
+
footer: 'Footer',
|
|
1157
|
+
id: 'template-unik', // opsional, auto-generate jika tidak diisi
|
|
1154
1158
|
templateButtons: [
|
|
1155
1159
|
{ id: 'btn1', text: 'Quick Reply' },
|
|
1156
1160
|
{ url: 'https://example.com', text: 'Kunjungi Website' },
|
|
@@ -1161,8 +1165,8 @@ await sock.sendMessage(jid, {
|
|
|
1161
1165
|
// Gambar sebagai header
|
|
1162
1166
|
await sock.sendMessage(jid, {
|
|
1163
1167
|
image: { url: 'https://example.com/img.jpg' },
|
|
1164
|
-
caption: 'Isi pesan',
|
|
1165
|
-
title: 'Judul',
|
|
1168
|
+
caption: 'Isi pesan',
|
|
1169
|
+
title: 'Judul',
|
|
1166
1170
|
footer: 'Footer',
|
|
1167
1171
|
templateButtons: [
|
|
1168
1172
|
{ id: 'btn1', text: 'Klik Sini' },
|
|
@@ -1171,14 +1175,13 @@ await sock.sendMessage(jid, {
|
|
|
1171
1175
|
})
|
|
1172
1176
|
```
|
|
1173
1177
|
|
|
1174
|
-
> **Tipe tombol:** `{ id, text }` → quick reply
|
|
1178
|
+
> **Tipe tombol:** `{ id, text }` → quick reply · `{ url, text }` → URL button · `{ call, text }` → call button.
|
|
1175
1179
|
|
|
1176
|
-
</details>
|
|
1177
1180
|
|
|
1178
|
-
|
|
1181
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1182
|
+
|
|
1179
1183
|
|
|
1180
|
-
|
|
1181
|
-
<summary>🌊 Native Flow</summary>
|
|
1184
|
+
## 🌊 Native Flow
|
|
1182
1185
|
|
|
1183
1186
|
```js
|
|
1184
1187
|
// Quick reply
|
|
@@ -1186,7 +1189,7 @@ await sock.sendMessage(jid, {
|
|
|
1186
1189
|
text: 'Pilih aksi',
|
|
1187
1190
|
footer: 'Footer pesan',
|
|
1188
1191
|
nativeFlow: [
|
|
1189
|
-
{ id: '1', text: 'Opsi 1' },
|
|
1192
|
+
{ id: '1', text: 'Opsi 1' },
|
|
1190
1193
|
{ id: '2', text: 'Opsi 2' }
|
|
1191
1194
|
]
|
|
1192
1195
|
})
|
|
@@ -1232,38 +1235,19 @@ await sock.sendMessage(jid, {
|
|
|
1232
1235
|
]
|
|
1233
1236
|
})
|
|
1234
1237
|
|
|
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
|
|
1238
|
+
// Gambar sebagai header
|
|
1246
1239
|
await sock.sendMessage(jid, {
|
|
1247
1240
|
image: { url: 'https://example.com/img.jpg' },
|
|
1248
|
-
caption: 'Isi pesan',
|
|
1249
|
-
title: 'Judul',
|
|
1250
|
-
subtitle: 'Subjudul',
|
|
1241
|
+
caption: 'Isi pesan',
|
|
1242
|
+
title: 'Judul',
|
|
1243
|
+
subtitle: 'Subjudul',
|
|
1251
1244
|
footer: 'Footer',
|
|
1252
1245
|
nativeFlow: [
|
|
1253
1246
|
{ id: '1', text: 'Tombol 1' }
|
|
1254
1247
|
]
|
|
1255
1248
|
})
|
|
1256
1249
|
|
|
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
|
|
1250
|
+
// offerText — limited time offer banner
|
|
1267
1251
|
await sock.sendMessage(jid, {
|
|
1268
1252
|
text: 'Penawaran terbatas!',
|
|
1269
1253
|
offerText: 'Diskon 50%',
|
|
@@ -1275,7 +1259,7 @@ await sock.sendMessage(jid, {
|
|
|
1275
1259
|
]
|
|
1276
1260
|
})
|
|
1277
1261
|
|
|
1278
|
-
// optionText — tombol
|
|
1262
|
+
// optionText — tombol masuk ke bottom sheet
|
|
1279
1263
|
await sock.sendMessage(jid, {
|
|
1280
1264
|
text: 'Pilih opsi',
|
|
1281
1265
|
optionText: 'Lihat Semua Opsi',
|
|
@@ -1285,26 +1269,15 @@ await sock.sendMessage(jid, {
|
|
|
1285
1269
|
{ id: '2', text: 'Opsi B' }
|
|
1286
1270
|
]
|
|
1287
1271
|
})
|
|
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
1272
|
```
|
|
1299
1273
|
|
|
1300
|
-
> **Tipe tombol ditentukan otomatis
|
|
1274
|
+
> **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'`).
|
|
1301
1275
|
|
|
1302
|
-
</details>
|
|
1303
1276
|
|
|
1304
|
-
|
|
1277
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1278
|
+
|
|
1305
1279
|
|
|
1306
|
-
|
|
1307
|
-
<summary>🎠 Carousel</summary>
|
|
1280
|
+
## 🎠 Carousel
|
|
1308
1281
|
|
|
1309
1282
|
```js
|
|
1310
1283
|
await sock.sendMessage(jid, {
|
|
@@ -1332,48 +1305,24 @@ await sock.sendMessage(jid, {
|
|
|
1332
1305
|
})
|
|
1333
1306
|
```
|
|
1334
1307
|
|
|
1335
|
-
</details>
|
|
1336
|
-
|
|
1337
|
-
---
|
|
1338
|
-
|
|
1339
|
-
<details>
|
|
1340
|
-
<summary>🏷️ Status Mention</summary>
|
|
1341
1308
|
|
|
1342
|
-
|
|
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
|
-
})
|
|
1309
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1348
1310
|
|
|
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
|
-
```
|
|
1355
1311
|
|
|
1356
|
-
|
|
1312
|
+
## 🤖 Rich Message (AI)
|
|
1357
1313
|
|
|
1358
|
-
|
|
1314
|
+
> Rich message menggunakan format `AIRichResponseMessage` yang tampil seperti respons AI di WhatsApp. Semua tipe bisa dipakai secara flat (field langsung) atau dikombinasikan via `richResponse: [...]`.
|
|
1359
1315
|
|
|
1360
|
-
|
|
1316
|
+
> ⚠️ **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).
|
|
1361
1317
|
|
|
1362
|
-
<details>
|
|
1363
|
-
<summary>🤖 Rich Message (AI)</summary>
|
|
1364
1318
|
|
|
1365
|
-
|
|
1319
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1366
1320
|
|
|
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
1321
|
|
|
1369
1322
|
### ✍️ addText
|
|
1370
1323
|
|
|
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
1324
|
```js
|
|
1376
|
-
// ✅ Cara benar — pakai richResponse array
|
|
1325
|
+
// ✅ Cara benar — pakai richResponse array untuk teks murni
|
|
1377
1326
|
await sock.sendMessage(jid, {
|
|
1378
1327
|
richResponse: [
|
|
1379
1328
|
{ text: 'Ini teks dari AI dengan *markdown* dan **bold**.' }
|
|
@@ -1385,33 +1334,19 @@ await sock.sendMessage(jid, {
|
|
|
1385
1334
|
```
|
|
1386
1335
|
|
|
1387
1336
|
```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
|
|
1337
|
+
// ❌ SALAH — contentText saja tidak trigger rich message
|
|
1401
1338
|
await sock.sendMessage(jid, {
|
|
1402
1339
|
contentText: 'halooo',
|
|
1403
|
-
headerText: 'Judul'
|
|
1404
|
-
footerText: 'Footer',
|
|
1405
|
-
disclaimerText: 'Generated by AI'
|
|
1340
|
+
headerText: 'Judul'
|
|
1406
1341
|
// → Error: Invalid media type
|
|
1407
1342
|
})
|
|
1408
1343
|
```
|
|
1409
1344
|
|
|
1410
|
-
---
|
|
1411
1345
|
|
|
1412
|
-
|
|
1346
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1347
|
+
|
|
1413
1348
|
|
|
1414
|
-
|
|
1349
|
+
### 💻 addCode
|
|
1415
1350
|
|
|
1416
1351
|
```js
|
|
1417
1352
|
await sock.sendMessage(jid, {
|
|
@@ -1446,11 +1381,11 @@ await sock.sendMessage(jid, {
|
|
|
1446
1381
|
| JSON | `json` |
|
|
1447
1382
|
| YAML | `yaml`, `yml` |
|
|
1448
1383
|
|
|
1449
|
-
---
|
|
1450
1384
|
|
|
1451
|
-
|
|
1385
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1452
1386
|
|
|
1453
|
-
|
|
1387
|
+
|
|
1388
|
+
### 📊 addTable
|
|
1454
1389
|
|
|
1455
1390
|
```js
|
|
1456
1391
|
await sock.sendMessage(jid, {
|
|
@@ -1476,11 +1411,11 @@ await sock.sendMessage(jid, {
|
|
|
1476
1411
|
})
|
|
1477
1412
|
```
|
|
1478
1413
|
|
|
1479
|
-
---
|
|
1480
1414
|
|
|
1481
|
-
|
|
1415
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1482
1416
|
|
|
1483
|
-
|
|
1417
|
+
|
|
1418
|
+
### 🖼️ addImage
|
|
1484
1419
|
|
|
1485
1420
|
```js
|
|
1486
1421
|
// Satu gambar
|
|
@@ -1496,18 +1431,15 @@ await sock.sendMessage(jid, {
|
|
|
1496
1431
|
'https://example.com/photo2.jpg',
|
|
1497
1432
|
'https://example.com/photo3.jpg'
|
|
1498
1433
|
],
|
|
1499
|
-
headerText: 'Koleksi gambar'
|
|
1500
|
-
footerText: 'Semoga suka'
|
|
1434
|
+
headerText: 'Koleksi gambar'
|
|
1501
1435
|
})
|
|
1502
1436
|
```
|
|
1503
1437
|
|
|
1504
|
-
> `image` menerima string URL atau array string URL. Berbeda dengan `gridImage` (format verbose), `image` adalah shorthand yang lebih praktis.
|
|
1505
1438
|
|
|
1506
|
-
|
|
1439
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1507
1440
|
|
|
1508
|
-
### 🎬 addVideo
|
|
1509
1441
|
|
|
1510
|
-
|
|
1442
|
+
### 🎬 addVideo
|
|
1511
1443
|
|
|
1512
1444
|
```js
|
|
1513
1445
|
// Satu video
|
|
@@ -1532,13 +1464,11 @@ await sock.sendMessage(jid, {
|
|
|
1532
1464
|
})
|
|
1533
1465
|
```
|
|
1534
1466
|
|
|
1535
|
-
> Format URL video: `'url'` atau `'url|durasi_detik'`. Durasi dalam satuan detik, default 0.
|
|
1536
1467
|
|
|
1537
|
-
|
|
1468
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1538
1469
|
|
|
1539
|
-
### 🔗 addSource
|
|
1540
1470
|
|
|
1541
|
-
|
|
1471
|
+
### 🔗 addSource
|
|
1542
1472
|
|
|
1543
1473
|
```js
|
|
1544
1474
|
await sock.sendMessage(jid, {
|
|
@@ -1561,8 +1491,6 @@ await sock.sendMessage(jid, {
|
|
|
1561
1491
|
})
|
|
1562
1492
|
```
|
|
1563
1493
|
|
|
1564
|
-
**Field tiap sumber:**
|
|
1565
|
-
|
|
1566
1494
|
| Field | Tipe | Keterangan |
|
|
1567
1495
|
|-------|------|------------|
|
|
1568
1496
|
| `url` | string | URL tujuan (wajib) |
|
|
@@ -1572,11 +1500,11 @@ await sock.sendMessage(jid, {
|
|
|
1572
1500
|
| `favicon` | string | URL favicon (opsional) |
|
|
1573
1501
|
| `source_type` | string | Default `'THIRD_PARTY'` |
|
|
1574
1502
|
|
|
1575
|
-
---
|
|
1576
1503
|
|
|
1577
|
-
|
|
1504
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1578
1505
|
|
|
1579
|
-
|
|
1506
|
+
|
|
1507
|
+
### 🎥 addReels
|
|
1580
1508
|
|
|
1581
1509
|
```js
|
|
1582
1510
|
await sock.sendMessage(jid, {
|
|
@@ -1589,27 +1517,14 @@ await sock.sendMessage(jid, {
|
|
|
1589
1517
|
reels_title: 'Judul Reel 1',
|
|
1590
1518
|
likes_count: 1200,
|
|
1591
1519
|
view_count: 50000,
|
|
1592
|
-
shares_count: 300,
|
|
1593
1520
|
reel_source: 'IG',
|
|
1594
1521
|
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
1522
|
}
|
|
1606
1523
|
],
|
|
1607
1524
|
headerText: 'Rekomendasi video'
|
|
1608
1525
|
})
|
|
1609
1526
|
```
|
|
1610
1527
|
|
|
1611
|
-
**Field tiap reel:**
|
|
1612
|
-
|
|
1613
1528
|
| Field | Tipe | Keterangan |
|
|
1614
1529
|
|-------|------|------------|
|
|
1615
1530
|
| `username` / `title` | string | Nama kreator |
|
|
@@ -1619,15 +1534,14 @@ await sock.sendMessage(jid, {
|
|
|
1619
1534
|
| `reels_title` | string | Judul reel |
|
|
1620
1535
|
| `likes_count` / `like` | number | Jumlah like |
|
|
1621
1536
|
| `view_count` / `view` | number | Jumlah views |
|
|
1622
|
-
| `shares_count` / `share` | number | Jumlah share |
|
|
1623
1537
|
| `reel_source` / `source` | string | `'IG'`, `'TT'`, dll |
|
|
1624
1538
|
| `is_verified` / `verified` | boolean | Akun terverifikasi |
|
|
1625
1539
|
|
|
1626
|
-
---
|
|
1627
1540
|
|
|
1628
|
-
|
|
1541
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1629
1542
|
|
|
1630
|
-
|
|
1543
|
+
|
|
1544
|
+
### 🛍️ addProduct
|
|
1631
1545
|
|
|
1632
1546
|
```js
|
|
1633
1547
|
// Satu produk (Single layout)
|
|
@@ -1638,8 +1552,7 @@ await sock.sendMessage(jid, {
|
|
|
1638
1552
|
price: 'Rp 150.000',
|
|
1639
1553
|
sale_price: 'Rp 120.000',
|
|
1640
1554
|
product_url: 'https://toko.example.com/produk',
|
|
1641
|
-
image_url: 'https://example.com/produk.jpg'
|
|
1642
|
-
icon_url: 'https://example.com/icon.jpg'
|
|
1555
|
+
image_url: 'https://example.com/produk.jpg'
|
|
1643
1556
|
},
|
|
1644
1557
|
headerText: 'Rekomendasi produk untukmu'
|
|
1645
1558
|
})
|
|
@@ -1649,14 +1562,12 @@ await sock.sendMessage(jid, {
|
|
|
1649
1562
|
richProduct: [
|
|
1650
1563
|
{
|
|
1651
1564
|
title: 'Produk A',
|
|
1652
|
-
brand: 'Brand X',
|
|
1653
1565
|
price: 'Rp 50.000',
|
|
1654
1566
|
product_url: 'https://toko.example.com/a',
|
|
1655
1567
|
image_url: 'https://example.com/a.jpg'
|
|
1656
1568
|
},
|
|
1657
1569
|
{
|
|
1658
1570
|
title: 'Produk B',
|
|
1659
|
-
brand: 'Brand Y',
|
|
1660
1571
|
price: 'Rp 75.000',
|
|
1661
1572
|
sale_price: 'Rp 60.000',
|
|
1662
1573
|
product_url: 'https://toko.example.com/b',
|
|
@@ -1667,46 +1578,27 @@ await sock.sendMessage(jid, {
|
|
|
1667
1578
|
})
|
|
1668
1579
|
```
|
|
1669
1580
|
|
|
1670
|
-
**
|
|
1581
|
+
> Object tunggal → **Single layout** · Array → **HScroll layout**
|
|
1671
1582
|
|
|
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
1583
|
|
|
1682
|
-
|
|
1584
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1683
1585
|
|
|
1684
|
-
---
|
|
1685
1586
|
|
|
1686
1587
|
### 📝 addPost
|
|
1687
1588
|
|
|
1688
|
-
Kirim kartu post sosial media (Instagram, TikTok, dll) dalam horizontal scroll.
|
|
1689
|
-
|
|
1690
1589
|
```js
|
|
1691
1590
|
// Satu post
|
|
1692
1591
|
await sock.sendMessage(jid, {
|
|
1693
1592
|
richPost: {
|
|
1694
|
-
title: 'Judul Post',
|
|
1695
|
-
subtitle: 'Subjudul',
|
|
1696
1593
|
username: 'namauser',
|
|
1697
1594
|
profile_picture_url: 'https://example.com/avatar.jpg',
|
|
1698
1595
|
is_verified: true,
|
|
1699
1596
|
thumbnail_url: 'https://example.com/thumb.jpg',
|
|
1700
1597
|
post_caption: 'Caption post ini',
|
|
1701
1598
|
likes_count: 5000,
|
|
1702
|
-
comments_count: 200,
|
|
1703
|
-
shares_count: 100,
|
|
1704
1599
|
post_url: 'https://instagram.com/p/xxx',
|
|
1705
|
-
post_deeplink: 'instagram://post/xxx',
|
|
1706
1600
|
source_app: 'INSTAGRAM',
|
|
1707
|
-
|
|
1708
|
-
orientation: 'LANDSCAPE', // 'LANDSCAPE' | 'PORTRAIT'
|
|
1709
|
-
post_type: 'VIDEO' // 'VIDEO' | 'IMAGE'
|
|
1601
|
+
orientation: 'LANDSCAPE'
|
|
1710
1602
|
},
|
|
1711
1603
|
headerText: 'Post terpopuler'
|
|
1712
1604
|
})
|
|
@@ -1717,7 +1609,6 @@ await sock.sendMessage(jid, {
|
|
|
1717
1609
|
{
|
|
1718
1610
|
username: 'user1',
|
|
1719
1611
|
thumbnail_url: 'https://example.com/thumb1.jpg',
|
|
1720
|
-
post_caption: 'Caption post pertama',
|
|
1721
1612
|
likes_count: 3000,
|
|
1722
1613
|
post_url: 'https://instagram.com/p/aaa',
|
|
1723
1614
|
source_app: 'INSTAGRAM'
|
|
@@ -1725,7 +1616,6 @@ await sock.sendMessage(jid, {
|
|
|
1725
1616
|
{
|
|
1726
1617
|
username: 'user2',
|
|
1727
1618
|
thumbnail_url: 'https://example.com/thumb2.jpg',
|
|
1728
|
-
post_caption: 'Caption post kedua',
|
|
1729
1619
|
likes_count: 1500,
|
|
1730
1620
|
post_url: 'https://tiktok.com/@user2/video/yyy',
|
|
1731
1621
|
source_app: 'TIKTOK'
|
|
@@ -1735,61 +1625,27 @@ await sock.sendMessage(jid, {
|
|
|
1735
1625
|
})
|
|
1736
1626
|
```
|
|
1737
1627
|
|
|
1738
|
-
**Field tiap post:**
|
|
1739
1628
|
|
|
1740
|
-
|
|
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'` |
|
|
1629
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1759
1630
|
|
|
1760
|
-
---
|
|
1761
1631
|
|
|
1762
1632
|
### 💡 addTip
|
|
1763
1633
|
|
|
1764
|
-
Kirim teks pendek sebagai metadata/tip (tampil lebih kecil dan subtle).
|
|
1765
|
-
|
|
1766
1634
|
```js
|
|
1767
1635
|
await sock.sendMessage(jid, {
|
|
1768
1636
|
tip: 'Informasi ini dibuat oleh AI berdasarkan data terbaru.',
|
|
1769
1637
|
headerText: 'Ringkasan'
|
|
1770
1638
|
})
|
|
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
1639
|
```
|
|
1778
1640
|
|
|
1779
|
-
---
|
|
1780
1641
|
|
|
1781
|
-
|
|
1642
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1782
1643
|
|
|
1783
|
-
Kirim saran prompt follow-up sebagai pill buttons yang bisa langsung diklik user.
|
|
1784
1644
|
|
|
1785
|
-
|
|
1786
|
-
// Satu saran
|
|
1787
|
-
await sock.sendMessage(jid, {
|
|
1788
|
-
contentText: 'Begitulah penjelasannya.',
|
|
1789
|
-
suggest: 'Jelaskan lebih detail'
|
|
1790
|
-
})
|
|
1645
|
+
### 🔮 addSuggest
|
|
1791
1646
|
|
|
1792
|
-
|
|
1647
|
+
```js
|
|
1648
|
+
// Beberapa saran (tampil sebagai pill button)
|
|
1793
1649
|
await sock.sendMessage(jid, {
|
|
1794
1650
|
contentText: 'Apakah ada yang ingin kamu tanyakan?',
|
|
1795
1651
|
suggest: [
|
|
@@ -1801,91 +1657,13 @@ await sock.sendMessage(jid, {
|
|
|
1801
1657
|
})
|
|
1802
1658
|
```
|
|
1803
1659
|
|
|
1804
|
-
> Saran tampil sebagai pill button di bawah pesan. Saat user mengetuk salah satu, teks saran tersebut akan terkirim sebagai pesan baru.
|
|
1805
1660
|
|
|
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).
|
|
1661
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1813
1662
|
|
|
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
|
-
---
|
|
1882
1663
|
|
|
1883
1664
|
### 🗺️ Map (Rich)
|
|
1884
1665
|
|
|
1885
|
-
Kirim peta interaktif dengan anotasi lokasi.
|
|
1886
|
-
|
|
1887
1666
|
```js
|
|
1888
|
-
// Satu lokasi
|
|
1889
1667
|
await sock.sendMessage(jid, {
|
|
1890
1668
|
map: {
|
|
1891
1669
|
centerLatitude: -6.2088,
|
|
@@ -1905,46 +1683,17 @@ await sock.sendMessage(jid, {
|
|
|
1905
1683
|
},
|
|
1906
1684
|
headerText: 'Lokasi yang kamu cari'
|
|
1907
1685
|
})
|
|
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
1686
|
```
|
|
1925
1687
|
|
|
1926
|
-
---
|
|
1927
1688
|
|
|
1928
|
-
|
|
1689
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1690
|
+
|
|
1929
1691
|
|
|
1930
|
-
|
|
1692
|
+
### 🧮 LaTeX (Rich)
|
|
1931
1693
|
|
|
1932
1694
|
> `url` di setiap expression akan **otomatis di-generate** dari [latex.codecogs.com](https://latex.codecogs.com) jika tidak diisi.
|
|
1933
1695
|
|
|
1934
1696
|
```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
1697
|
await sock.sendMessage(jid, {
|
|
1949
1698
|
latex: {
|
|
1950
1699
|
text: 'Rumus-rumus fisika dasar:',
|
|
@@ -1954,85 +1703,67 @@ await sock.sendMessage(jid, {
|
|
|
1954
1703
|
{ expression: 's = ut + \\frac{1}{2}at^2', width: 160, height: 50 }
|
|
1955
1704
|
]
|
|
1956
1705
|
},
|
|
1957
|
-
headerText: 'Hukum Newton'
|
|
1958
|
-
disclaimerText: 'Fisika dasar kelas 10'
|
|
1706
|
+
headerText: 'Hukum Newton'
|
|
1959
1707
|
})
|
|
1960
1708
|
```
|
|
1961
1709
|
|
|
1962
1710
|
|
|
1711
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1963
1712
|
|
|
1964
|
-
---
|
|
1965
|
-
|
|
1966
|
-
### 🧮 generateLatexContent / sendLatex (Standalone)
|
|
1967
1713
|
|
|
1968
|
-
|
|
1714
|
+
### 🖼️ Grid Image (Rich)
|
|
1969
1715
|
|
|
1970
1716
|
```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!'
|
|
1717
|
+
await sock.sendMessage(jid, {
|
|
1718
|
+
gridImage: {
|
|
1719
|
+
gridImageUrl: 'https://picsum.photos/id/10/300/300',
|
|
1720
|
+
imageUrls: ['https://picsum.photos/id/11/300/300']
|
|
1721
|
+
},
|
|
1722
|
+
headerText: 'Hasil pencarian gambar'
|
|
1981
1723
|
})
|
|
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
1724
|
```
|
|
1993
1725
|
|
|
1994
|
-
### 📊 sendTable / sendTableV2 / sendList (Standalone)
|
|
1995
1726
|
|
|
1996
|
-
|
|
1997
|
-
// sendTable — format V1
|
|
1998
|
-
await sock.sendTable(jid, 'Data Kota', ['Kota', 'Populasi'], [['Jakarta', '10jt'], ['Surabaya', '3jt']], m)
|
|
1727
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1999
1728
|
|
|
2000
|
-
// sendList
|
|
2001
|
-
await sock.sendList(jid, 'Daftar Belanja', ['Apel', 'Jeruk', 'Mangga'], m)
|
|
2002
|
-
```
|
|
2003
1729
|
|
|
2004
|
-
###
|
|
1730
|
+
### 📸 Inline Image (Rich)
|
|
2005
1731
|
|
|
2006
1732
|
```js
|
|
2007
|
-
await sock.
|
|
1733
|
+
await sock.sendMessage(jid, {
|
|
1734
|
+
inlineImage: {
|
|
1735
|
+
imageUrl: 'https://picsum.photos/id/237/300/300',
|
|
1736
|
+
imageText: 'Ilustrasi gambar',
|
|
1737
|
+
alignment: 2, // 0 = leading, 1 = trailing, 2 = center
|
|
1738
|
+
tapLinkUrl: 'https://picsum.photos'
|
|
1739
|
+
},
|
|
1740
|
+
headerText: 'Berikut ilustrasinya'
|
|
1741
|
+
})
|
|
2008
1742
|
```
|
|
2009
1743
|
|
|
2010
|
-
### 🔗 sendLink / sendLinkV2 (Standalone)
|
|
2011
1744
|
|
|
2012
|
-
|
|
2013
|
-
await sock.sendLink(jid, 'Kunjungi dokumentasi ini', [{ url: 'https://docs.example.com', displayName: 'Docs' }], m)
|
|
2014
|
-
```
|
|
1745
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
2015
1746
|
|
|
2016
|
-
### 🎁 sendRichMessage / sendUnifiedResponse / captureUnifiedResponse (Standalone)
|
|
2017
1747
|
|
|
2018
|
-
|
|
2019
|
-
// Kirim array submessage mentah
|
|
2020
|
-
await sock.sendRichMessage(jid, [
|
|
2021
|
-
{ messageType: 2, messageText: 'Teks pertama' },
|
|
2022
|
-
{ messageType: 2, messageText: 'Teks kedua' }
|
|
2023
|
-
], m)
|
|
1748
|
+
### 🎞️ Dynamic / GIF (Rich)
|
|
2024
1749
|
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
1750
|
+
```js
|
|
1751
|
+
await sock.sendMessage(jid, {
|
|
1752
|
+
dynamic: {
|
|
1753
|
+
url: 'https://example.com/animation.gif',
|
|
1754
|
+
type: 2, // 1 = IMAGE, 2 = GIF
|
|
1755
|
+
version: 1,
|
|
1756
|
+
loopCount: 0 // 0 = loop selamanya
|
|
1757
|
+
},
|
|
1758
|
+
headerText: 'Animasi untuk kamu'
|
|
1759
|
+
})
|
|
2028
1760
|
```
|
|
2029
|
-
---
|
|
2030
1761
|
|
|
2031
|
-
### 📦 Content Items (Rich)
|
|
2032
1762
|
|
|
2033
|
-
|
|
1763
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
2034
1764
|
|
|
2035
|
-
|
|
1765
|
+
|
|
1766
|
+
### 📦 Content Items (Rich)
|
|
2036
1767
|
|
|
2037
1768
|
```js
|
|
2038
1769
|
await sock.sendMessage(jid, {
|
|
@@ -2045,13 +1776,6 @@ await sock.sendMessage(jid, {
|
|
|
2045
1776
|
profileIconUrl: 'https://example.com/avatar1.jpg',
|
|
2046
1777
|
thumbnailUrl: 'https://example.com/thumb1.jpg',
|
|
2047
1778
|
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
1779
|
}
|
|
2056
1780
|
]
|
|
2057
1781
|
},
|
|
@@ -2059,42 +1783,13 @@ await sock.sendMessage(jid, {
|
|
|
2059
1783
|
})
|
|
2060
1784
|
```
|
|
2061
1785
|
|
|
2062
|
-
---
|
|
2063
|
-
|
|
2064
|
-
### 🔗 Links (Rich)
|
|
2065
|
-
|
|
2066
|
-
Kirim teks dengan inline citation/reference link.
|
|
2067
1786
|
|
|
2068
|
-
|
|
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
|
-
```
|
|
1787
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
2089
1788
|
|
|
2090
|
-
---
|
|
2091
1789
|
|
|
2092
1790
|
### 🎁 Rich Response (Gabungan)
|
|
2093
1791
|
|
|
2094
|
-
Kirim kombinasi berbagai tipe Rich Message dalam satu pesan menggunakan mode array.
|
|
2095
|
-
|
|
2096
1792
|
```js
|
|
2097
|
-
// Kombinasi teks + kode + tabel
|
|
2098
1793
|
await sock.sendMessage(jid, {
|
|
2099
1794
|
richResponse: [
|
|
2100
1795
|
{ text: 'Penjelasan singkat:' },
|
|
@@ -2103,42 +1798,20 @@ await sock.sendMessage(jid, {
|
|
|
2103
1798
|
table: [['Kolom A', 'Kolom B'], ['Nilai 1', 'Nilai 2']],
|
|
2104
1799
|
title: 'Hasil'
|
|
2105
1800
|
},
|
|
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
1801
|
{ richImage: ['https://example.com/img1.jpg', 'https://example.com/img2.jpg'] },
|
|
2116
1802
|
{ 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
1803
|
{ tip: 'Informasi ini dihasilkan secara otomatis.' },
|
|
2130
|
-
{ suggest: ['Tanya lebih lanjut', 'Lihat contoh lain'
|
|
1804
|
+
{ suggest: ['Tanya lebih lanjut', 'Lihat contoh lain'] }
|
|
2131
1805
|
],
|
|
2132
|
-
disclaimerText: '
|
|
1806
|
+
disclaimerText: 'Generated by AI'
|
|
2133
1807
|
})
|
|
2134
1808
|
```
|
|
2135
1809
|
|
|
2136
|
-
</details>
|
|
2137
1810
|
|
|
2138
|
-
|
|
1811
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1812
|
+
|
|
2139
1813
|
|
|
2140
|
-
|
|
2141
|
-
<summary>📥 Terima & Decode Rich Message</summary>
|
|
1814
|
+
### 📥 Terima & Decode Rich Message
|
|
2142
1815
|
|
|
2143
1816
|
```js
|
|
2144
1817
|
const { normalizeMessageContent, parseRichMessage } = require('@nuiisweety/baileys')
|
|
@@ -2152,33 +1825,15 @@ sock.ev.on('messages.upsert', async ({ messages }) => {
|
|
|
2152
1825
|
|
|
2153
1826
|
for (const sub of parsed.submessages) {
|
|
2154
1827
|
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
|
|
1828
|
+
case 'text': console.log('Teks:', sub.text); break
|
|
1829
|
+
case 'code': console.log('Kode:', sub.language, sub.raw); break
|
|
1830
|
+
case 'table': console.log('Tabel:', sub.title, sub.rows); break
|
|
1831
|
+
case 'gridImage': console.log('Grid Image:', sub.gridImageUrl); break
|
|
1832
|
+
case 'inlineImage': console.log('Inline Image:', sub.imageUrl); break
|
|
1833
|
+
case 'dynamic': console.log('Dynamic:', sub.url); break
|
|
1834
|
+
case 'map': console.log('Map:', sub.centerLatitude, sub.centerLongitude); break
|
|
1835
|
+
case 'latex': console.log('LaTeX:', sub.expressions); break
|
|
1836
|
+
case 'contentItems': console.log('Content Items:', sub.items); break
|
|
2182
1837
|
}
|
|
2183
1838
|
}
|
|
2184
1839
|
}
|
|
@@ -2187,12 +1842,46 @@ sock.ev.on('messages.upsert', async ({ messages }) => {
|
|
|
2187
1842
|
|
|
2188
1843
|
> `parseRichMessage` menerima `null` atau `undefined` dengan aman — return `null` jika tidak ada rich message.
|
|
2189
1844
|
|
|
2190
|
-
</details>
|
|
2191
1845
|
|
|
2192
|
-
|
|
1846
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1847
|
+
|
|
2193
1848
|
|
|
2194
|
-
|
|
2195
|
-
|
|
1849
|
+
### Standalone Functions
|
|
1850
|
+
|
|
1851
|
+
```js
|
|
1852
|
+
// sendLatex
|
|
1853
|
+
await sock.sendLatex(jid, m, {
|
|
1854
|
+
text: 'Rumus Pythagoras:',
|
|
1855
|
+
expressions: [
|
|
1856
|
+
{ latexExpression: 'a^2 + b^2 = c^2', width: 150, height: 45 }
|
|
1857
|
+
],
|
|
1858
|
+
headerText: 'Matematika'
|
|
1859
|
+
})
|
|
1860
|
+
|
|
1861
|
+
// sendTable
|
|
1862
|
+
await sock.sendTable(jid, 'Data Kota', ['Kota', 'Populasi'], [['Jakarta', '10jt'], ['Surabaya', '3jt']], m)
|
|
1863
|
+
|
|
1864
|
+
// sendList
|
|
1865
|
+
await sock.sendList(jid, 'Daftar Belanja', ['Apel', 'Jeruk', 'Mangga'], m)
|
|
1866
|
+
|
|
1867
|
+
// sendCodeBlock
|
|
1868
|
+
await sock.sendCodeBlock(jid, 'console.log("Hello")', m, { language: 'javascript', title: 'Contoh JS' })
|
|
1869
|
+
|
|
1870
|
+
// sendLink
|
|
1871
|
+
await sock.sendLink(jid, 'Kunjungi dokumentasi', [{ url: 'https://docs.example.com', displayName: 'Docs' }], m)
|
|
1872
|
+
|
|
1873
|
+
// sendRichMessage
|
|
1874
|
+
await sock.sendRichMessage(jid, [
|
|
1875
|
+
{ messageType: 2, messageText: 'Teks pertama' },
|
|
1876
|
+
{ messageType: 2, messageText: 'Teks kedua' }
|
|
1877
|
+
], m)
|
|
1878
|
+
```
|
|
1879
|
+
|
|
1880
|
+
|
|
1881
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1882
|
+
|
|
1883
|
+
|
|
1884
|
+
## 📃 List Reply
|
|
2196
1885
|
|
|
2197
1886
|
```js
|
|
2198
1887
|
await sock.sendMessage(jid, {
|
|
@@ -2204,12 +1893,11 @@ await sock.sendMessage(jid, {
|
|
|
2204
1893
|
})
|
|
2205
1894
|
```
|
|
2206
1895
|
|
|
2207
|
-
</details>
|
|
2208
1896
|
|
|
2209
|
-
|
|
1897
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
2210
1898
|
|
|
2211
|
-
|
|
2212
|
-
|
|
1899
|
+
|
|
1900
|
+
## 🎴 Sticker Pack
|
|
2213
1901
|
|
|
2214
1902
|
```js
|
|
2215
1903
|
await sock.sendMessage(jid, {
|
|
@@ -2232,12 +1920,11 @@ await sock.sendMessage(jid, {
|
|
|
2232
1920
|
})
|
|
2233
1921
|
```
|
|
2234
1922
|
|
|
2235
|
-
</details>
|
|
2236
1923
|
|
|
2237
|
-
|
|
1924
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1925
|
+
|
|
2238
1926
|
|
|
2239
|
-
|
|
2240
|
-
<summary>📢 External Ad Reply</summary>
|
|
1927
|
+
## 📢 External Ad Reply
|
|
2241
1928
|
|
|
2242
1929
|
```js
|
|
2243
1930
|
await sock.sendMessage(jid, {
|
|
@@ -2247,18 +1934,17 @@ await sock.sendMessage(jid, {
|
|
|
2247
1934
|
body: 'Deskripsi iklan',
|
|
2248
1935
|
thumbnail: fs.readFileSync('thumbnail.jpg'), // harus Buffer
|
|
2249
1936
|
url: 'https://example.com/produk',
|
|
2250
|
-
mediaType: 1,
|
|
1937
|
+
mediaType: 1,
|
|
2251
1938
|
largeThumbnail: false
|
|
2252
1939
|
}
|
|
2253
1940
|
})
|
|
2254
1941
|
```
|
|
2255
1942
|
|
|
2256
|
-
</details>
|
|
2257
1943
|
|
|
2258
|
-
|
|
1944
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1945
|
+
|
|
2259
1946
|
|
|
2260
|
-
|
|
2261
|
-
<summary>💳 Request Payment</summary>
|
|
1947
|
+
## 💳 Request Payment
|
|
2262
1948
|
|
|
2263
1949
|
```js
|
|
2264
1950
|
await sock.sendMessage(jid, {
|
|
@@ -2266,16 +1952,15 @@ await sock.sendMessage(jid, {
|
|
|
2266
1952
|
requestPaymentFrom: '628xxx@s.whatsapp.net',
|
|
2267
1953
|
amount1000: 50000000, // Rp 50.000 (unit 1/1000)
|
|
2268
1954
|
currencyCodeIso4217: 'IDR',
|
|
2269
|
-
expiryTimestamp: Date.now() + 86400000
|
|
1955
|
+
expiryTimestamp: Date.now() + 86400000
|
|
2270
1956
|
})
|
|
2271
1957
|
```
|
|
2272
1958
|
|
|
2273
|
-
</details>
|
|
2274
1959
|
|
|
2275
|
-
|
|
1960
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
1961
|
+
|
|
2276
1962
|
|
|
2277
|
-
|
|
2278
|
-
<summary>🧾 Invoice</summary>
|
|
1963
|
+
## 🧾 Invoice
|
|
2279
1964
|
|
|
2280
1965
|
```js
|
|
2281
1966
|
// Dengan gambar
|
|
@@ -2293,12 +1978,11 @@ await sock.sendMessage(jid, {
|
|
|
2293
1978
|
})
|
|
2294
1979
|
```
|
|
2295
1980
|
|
|
2296
|
-
</details>
|
|
2297
1981
|
|
|
2298
|
-
|
|
1982
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
2299
1983
|
|
|
2300
|
-
|
|
2301
|
-
|
|
1984
|
+
|
|
1985
|
+
## 📦 Order
|
|
2302
1986
|
|
|
2303
1987
|
```js
|
|
2304
1988
|
await sock.sendMessage(jid, {
|
|
@@ -2312,21 +1996,20 @@ await sock.sendMessage(jid, {
|
|
|
2312
1996
|
orderTitle: 'Pesanan #001',
|
|
2313
1997
|
sellerJid: '628xxx@s.whatsapp.net',
|
|
2314
1998
|
token: 'token_unik',
|
|
2315
|
-
totalAmount1000: 150000000,
|
|
1999
|
+
totalAmount1000: 150000000,
|
|
2316
2000
|
totalCurrencyCode: 'IDR'
|
|
2317
2001
|
}
|
|
2318
2002
|
})
|
|
2319
2003
|
```
|
|
2320
2004
|
|
|
2321
|
-
</details>
|
|
2322
2005
|
|
|
2323
|
-
|
|
2006
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
2324
2007
|
|
|
2325
|
-
|
|
2326
|
-
|
|
2008
|
+
|
|
2009
|
+
## 💨 Disappearing Messages
|
|
2327
2010
|
|
|
2328
2011
|
```js
|
|
2329
|
-
// Aktifkan (86400 detik = 24 jam
|
|
2012
|
+
// Aktifkan (default 86400 detik = 24 jam)
|
|
2330
2013
|
await sock.sendMessage(groupJid, { disappearingMessagesInChat: true })
|
|
2331
2014
|
|
|
2332
2015
|
// Nonaktifkan
|
|
@@ -2338,12 +2021,11 @@ await sock.sendMessage(groupJid, { disappearingMessagesInChat: 604800 }) // 7 h
|
|
|
2338
2021
|
|
|
2339
2022
|
> Hanya berfungsi di grup (`@g.us`).
|
|
2340
2023
|
|
|
2341
|
-
</details>
|
|
2342
2024
|
|
|
2343
|
-
|
|
2025
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/solar.png" width="100%"/>
|
|
2026
|
+
|
|
2344
2027
|
|
|
2345
|
-
|
|
2346
|
-
<summary>⚡ Raw Message</summary>
|
|
2028
|
+
## ⚡ Raw Message
|
|
2347
2029
|
|
|
2348
2030
|
```js
|
|
2349
2031
|
await sock.sendMessage(jid, {
|
|
@@ -2356,12 +2038,23 @@ await sock.sendMessage(jid, {
|
|
|
2356
2038
|
|
|
2357
2039
|
> Ketika `raw: true` ada, semua properti lain diteruskan langsung sebagai WAProto message tanpa pemrosesan tambahan.
|
|
2358
2040
|
|
|
2359
|
-
---
|
|
2360
2041
|
|
|
2361
|
-
|
|
2042
|
+
<br/>
|
|
2043
|
+
|
|
2044
|
+
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" width="100%"/>
|
|
2362
2045
|
|
|
2363
2046
|
<div align="center">
|
|
2364
2047
|
|
|
2365
|
-
|
|
2048
|
+
<br/>
|
|
2049
|
+
|
|
2050
|
+
<img src="https://readme-typing-svg.demolab.com?font=Fira+Code&size=14&duration=4000&pause=1000&color=C084FC¢er=true&vCenter=true&width=500&lines=Dibuat+dengan+%E2%9D%A4%EF%B8%8F+oleh+NuiiS4TORU;%40nuiisweety%2Fbaileys+%E2%80%94+fork+Baileys+terbaik" alt="footer"/>
|
|
2051
|
+
|
|
2052
|
+
<br/><br/>
|
|
2053
|
+
|
|
2054
|
+
<img src="https://img.shields.io/badge/Made%20with-%E2%9D%A4%EF%B8%8F-ff69b4?style=for-the-badge" alt="made with love"/>
|
|
2055
|
+
|
|
2056
|
+
<img src="https://img.shields.io/badge/Indonesia-🇮🇩-red?style=for-the-badge" alt="indonesia"/>
|
|
2057
|
+
|
|
2058
|
+
<br/><br/>
|
|
2366
2059
|
|
|
2367
2060
|
</div>
|