@pontasockets/baileys 0.3.4 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  <div align="center">
2
2
 
3
- ```
4
- ██████╗ ██████╗ ███╗ ██╗████████╗ █████╗
3
+ <pre>
4
+ ██████╗ ██████╗ ███╗ ██╗████████╗ █████╗
5
5
  ██╔══██╗██╔═══██╗████╗ ██║╚══██╔══╝██╔══██╗
6
6
  ██████╔╝██║ ██║██╔██╗ ██║ ██║ ███████║
7
7
  ██╔═══╝ ██║ ██║██║╚██╗██║ ██║ ██╔══██║
@@ -13,66 +13,94 @@
13
13
  ╚════██║██║ ██║██║ ██╔═██╗ ██╔══╝ ██║ ╚════██║
14
14
  ███████║╚██████╔╝╚██████╗██║ ██╗███████╗ ██║ ███████║
15
15
  ╚══════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝
16
- ```
16
+ </pre>
17
17
 
18
- ### **B A I L E Y S**
19
- *WhatsApp Web API · Custom Fork · Node.js*
18
+ **B A I L E Y S**
20
19
 
21
- <br>
20
+ WhatsApp Web API · Custom Fork · Node.js
22
21
 
23
- [![npm](https://img.shields.io/npm/v/@pontasockets/baileys?style=for-the-badge&color=7c3aed&logo=npm&logoColor=white&label=NPM)](https://npmjs.com/package/@pontasockets/baileys)
24
- [![license](https://img.shields.io/github/license/pontasockets/baileys?style=for-the-badge&color=10b981&logo=github&logoColor=white)](https://github.com/pontasockets/baileys/blob/main/LICENSE)
25
- [![stars](https://img.shields.io/github/stars/pontasockets/baileys?style=for-the-badge&color=f59e0b&logo=github&logoColor=white)](https://github.com/pontasockets/baileys/stargazers)
22
+ [![NPM Version](https://img.shields.io/npm/v/@pontasockets/baileys?style=flat-square&color=cb3837&label=npm)](https://www.npmjs.com/package/@pontasockets/baileys)
23
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18.x-339933?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org)
24
+ [![License](https://img.shields.io/badge/license-Non--Commercial-orange?style=flat-square)](./LICENSE)
25
+ [![Fork](https://img.shields.io/badge/fork-whiskeysockets%2Fbaileys-blue?style=flat-square)](https://github.com/WhiskeySockets/Baileys)
26
26
 
27
27
  <br>
28
28
 
29
- > *Extended from [@whiskeysockets/baileys](https://github.com/WhiskeySockets/Baileys) · Packed with exclusive patches & features*
29
+ > Extended from `@whiskeysockets/baileys` · Packed with exclusive patches & features
30
30
 
31
- <br>
31
+ </div>
32
32
 
33
33
  ---
34
34
 
35
- </div>
36
-
37
35
  ## 📑 Table of Contents
38
36
 
39
- - [What's Different](#-whats-different)
40
- - [Features](#-features)
41
- - [Installation](#-installation)
42
- - [Quick Start](#-quick-start)
43
- - [Documentation](#-documentation)
44
- - [Connecting Account](#-connecting-account)
45
- - [Handling Events](#-handling-events)
46
- - [Sending Messages](#-sending-messages)
47
- - [Newsletter](#-newsletter)
48
- - [Groups](#-groups)
49
- - [Privacy](#-privacy)
50
- - [Advanced](#-advanced)
51
- - [Contact](#-contact)
52
- - [Disclaimer](#-disclaimer)
37
+ - [What's Different](#-whats-different)
38
+ - [🌟 Features](#-features)
39
+ - [📥 Installation](#-installation)
40
+ - [🚀 Quick Start](#-quick-start)
41
+ - [📖 Documentation](#-documentation)
42
+ - [🔌 Connecting Account](#-connecting-account)
43
+ - [📡 Handling Events](#-handling-events)
44
+ - [📨 Sending Messages](#-sending-messages)
45
+ - [Standard Messages](#standard-messages)
46
+ - [📍 Location + Buttons](#-location--buttons)
47
+ - [📦 Order Status](#-order-status)
48
+ - [🤖 Rich Message](#-rich-message)
49
+ - [Rich Text](#-rich-text)
50
+ - [Rich Code Block](#-rich-code-block)
51
+ - [Rich Table](#-rich-table)
52
+ - [Rich Images](#-rich-images)
53
+ - [Rich Video](#-rich-video)
54
+ - [Rich Suggestions](#-rich-suggestions)
55
+ - [Rich LaTeX](#-rich-latex)
56
+ - [Rich Product](#-rich-product)
57
+ - [Rich Post](#-rich-post)
58
+ - [Rich Reels](#-rich-reels)
59
+ - [Rich Sources](#-rich-sources)
60
+ - [Rich Tip & Footer](#-rich-tip--footer)
61
+ - [Rich Mixed — items](#-rich-mixed--items)
62
+ - [Rich Response — richResponse](#-rich-response--richresponse)
63
+ - [📣 Newsletter](#-newsletter)
64
+ - [👥 Groups](#-groups)
65
+ - [🔒 Privacy](#-privacy)
66
+ - [⚙️ Advanced](#-advanced)
67
+ - [⚡ Contact](#-contact)
68
+ - [🤝 Contributing](#-contributing)
69
+ - [📜 License](#-license)
70
+ - [⚠️ Disclaimer](#-disclaimer)
53
71
 
54
72
  ---
55
73
 
56
74
  ## ✨ What's Different
57
75
 
58
- This fork introduces targeted custom patches on top of the original Baileys library. Here's everything that's been changed or added:
59
-
60
- <br>
76
+ This fork introduces targeted custom patches on top of the original Baileys library.
61
77
 
62
78
  | # | Patch | Description |
63
- |---|-------|-------------|
64
- | `01` | 🤖 **Code Block Message** | Send syntax-highlighted code via `{ code, language }` — renders as AI bot message in WhatsApp |
65
- | `02` | 📊 **Table Message** | Send structured tables via `{ table: { title?, headers, rows } }` renders as rich table in WhatsApp |
66
- | `03` | 📝 **Rich Text Message** | Send styled text via `{ richText: '...' }` renders as AI bot markdown text in WhatsApp |
67
- | `04` | 🔀 **Mixed Rich Message** | Combine text + code + table in one message via `{ items: [...] }` |
68
- | `05` | 🔗 **Inline Citation Message** | Send text with clickable footnote citations via `{ richResponse: [...] }` |
69
- | `02` | 🪪 **Custom Message ID** | All outgoing message IDs prefixed with `PONTASOCKETS` |
70
- | `03` | 🐛 **LID Bug Fixes** | Full fix for participant, mentionedJid, sender, and group admin LID resolution |
71
- | `04` | 📦 **makeInMemoryStore Fix** | Corrected store behavior for stable session handling |
72
- | `05` | 📣 **Newsletter Support** | Full channel/newsletter create, follow, react, and admin management |
73
- | `06` | 🤖 **AI Logo Message** | Support for AI bot avatar in message context |
74
- | `07` | 📊 **Logger Buffer Clear** | Prevents memory buildup from log buffers |
75
- | `08` | 🔁 **LID JID Conversion** | Auto-converts LID mentions, sender LID, and group member LID to JID |
79
+ |:---:|:---|:---|
80
+ | 01 | 🤖 Rich Text | Send AI bot styled markdown text via `{ richText }` |
81
+ | 02 | 💻 Rich Code Block | Syntax-highlighted code via `{ code, language }` or `{ codes: [...] }` |
82
+ | 03 | 📊 Rich Table | Structured table via `{ table: { title?, headers?, rows } }` |
83
+ | 04 | 🖼️ Rich Images | Image grid via `{ richImages: [...] }` — renders as AI image carousel |
84
+ | 05 | 🎥 Rich Video | Video embed via `{ richVideo }` — renders as AI animated media |
85
+ | 06 | 💡 Rich Suggestions | Follow-up prompt pills via `{ richSuggestions: [...] }` |
86
+ | 07 | 🔣 Rich LaTeX | Math formula render via `{ richLatex }` with GenAILatexItem |
87
+ | 08 | 🛍️ Rich Product | Product card(s) via `{ richProduct }` single or horizontal scroll |
88
+ | 09 | 📰 Rich Post | Post card(s) via `{ richPost }` single or horizontal scroll |
89
+ | 10 | 🎬 Rich Reels | Reels carousel via `{ richReels }` with sources metadata |
90
+ | 11 | 🔍 Rich Sources | Search result source list via `{ richSources }` |
91
+ | 12 | 📌 Rich Tip & Footer | Metadata text blocks via `{ richTip }` and `{ richFooter }` |
92
+ | 13 | 🔀 Rich Mixed | Combine all rich types freely via `{ items: [...] }` |
93
+ | 14 | 🔗 Rich Response | Full array mode with citations via `{ richResponse: [...] }` |
94
+ | 15 | 🪪 Custom Message ID | All outgoing message IDs prefixed with `PONTASOCKETS` |
95
+ | 16 | 🐛 LID Bug Fixes | Full fix for participant, mentionedJid, sender, group admin LID resolution |
96
+ | 17 | 📦 makeInMemoryStore Fix | Corrected store behavior for stable session handling |
97
+ | 18 | 📣 Newsletter Support | Full channel/newsletter create, follow, react, and admin management |
98
+ | 19 | 🤖 AI Logo Message | Support for AI bot avatar in message context |
99
+ | 20 | 📊 Logger Buffer Clear | Prevents memory buildup from log buffers |
100
+ | 21 | 🔁 LID → JID Conversion | Auto-converts LID mentions, sender LID, and group member LID to JID |
101
+ | 22 | 📍 Location + Buttons | Location message with list menu & extra buttons via `{ buttonLocation }` |
102
+ | 23 | 📢 Group Status | Send styled group status (text/media) with audience control via `{ groupStatus }` |
103
+ | 24 | 📦 Order Status | Interactive order tracking card with `order_status` native flow via `{ orderStatus }` |
76
104
 
77
105
  ---
78
106
 
@@ -81,9 +109,11 @@ This fork introduces targeted custom patches on top of the original Baileys libr
81
109
  ```
82
110
  ✔ Multi-Device Support ✔ End-to-End Encryption
83
111
  ✔ Real-Time Messaging ✔ Session Persistence
84
- Code Block Messages ✔ Newsletter Management
85
- ✔ Group & Channel Management ✔ Rich Interactive Messages
112
+ Rich AI Bot Messages ✔ Newsletter Management
113
+ ✔ Group & Channel Management ✔ Inline Citations & LaTeX
86
114
  ✔ Poll, Album, Carousel ✔ LID → JID Auto-Conversion
115
+ ✔ Product / Post / Reels Cards ✔ Math Formula Rendering
116
+ ✔ Location + Button Messages ✔ Group Status & Order Status
87
117
  ```
88
118
 
89
119
  ---
@@ -91,10 +121,10 @@ This fork introduces targeted custom patches on top of the original Baileys libr
91
121
  ## 📥 Installation
92
122
 
93
123
  ```bash
94
- # Using npm
124
+ # npm
95
125
  npm install @pontasockets/baileys
96
126
 
97
- # Using yarn
127
+ # yarn
98
128
  yarn add @pontasockets/baileys
99
129
  ```
100
130
 
@@ -102,11 +132,8 @@ yarn add @pontasockets/baileys
102
132
 
103
133
  ## 🚀 Quick Start
104
134
 
105
- ```javascript
106
- const {
107
- default: makeWASocket,
108
- useMultiFileAuthState,
109
- } = require('@pontasockets/baileys');
135
+ ```js
136
+ import makeWASocket, { useMultiFileAuthState } from '@pontasockets/baileys'
110
137
 
111
138
  async function start() {
112
139
  const { state, saveCreds } = await useMultiFileAuthState('./sessions')
@@ -136,9 +163,9 @@ start()
136
163
  <summary><b>🔗 Connect with QR Code</b></summary>
137
164
  <br>
138
165
 
139
- ```javascript
166
+ ```js
140
167
  const sock = makeWASocket({
141
- printQRInTerminal: true, // Display QR in terminal
168
+ printQRInTerminal: true,
142
169
  auth: state
143
170
  })
144
171
  ```
@@ -149,7 +176,7 @@ const sock = makeWASocket({
149
176
  <summary><b>🔢 Connect with Pairing Code</b></summary>
150
177
  <br>
151
178
 
152
- ```javascript
179
+ ```js
153
180
  const sock = makeWASocket({
154
181
  printQRInTerminal: false,
155
182
  auth: state
@@ -178,7 +205,7 @@ if (!sock.authState.creds.registered) {
178
205
  <summary><b>📌 Basic Message Listener</b></summary>
179
206
  <br>
180
207
 
181
- ```javascript
208
+ ```js
182
209
  sock.ev.on('messages.upsert', ({ messages }) => {
183
210
  const msg = messages[0]
184
211
  console.log('From:', msg.key.remoteJid)
@@ -192,7 +219,7 @@ sock.ev.on('messages.upsert', ({ messages }) => {
192
219
  <summary><b>🗳️ Decrypt Poll Votes</b></summary>
193
220
  <br>
194
221
 
195
- ```javascript
222
+ ```js
196
223
  sock.ev.on('messages.update', (m) => {
197
224
  if (m.pollUpdates) {
198
225
  console.log('Poll vote received:', m.pollUpdates)
@@ -213,757 +240,1364 @@ sock.sendMessage(jid, content, options?)
213
240
  ↳ options — Optional: { quoted, ephemeral, ... }
214
241
  ```
215
242
 
243
+ #### Standard Messages
244
+
216
245
  <details>
217
246
  <summary><b>📝 Text Message</b></summary>
218
247
  <br>
219
248
 
220
- ```javascript
221
- // Simple text
249
+ ```js
222
250
  await sock.sendMessage(jid, { text: 'Hello!' })
223
251
 
224
252
  // With quoted reply
225
253
  await sock.sendMessage(jid, { text: 'Reply!' }, { quoted: message })
226
-
227
- // With link preview
228
- await sock.sendMessage(jid, {
229
- text: 'Visit https://example.com',
230
- linkPreview: {
231
- 'canonical-url': 'https://example.com',
232
- title: 'Example Domain',
233
- description: 'A demo website',
234
- jpegThumbnail: fs.readFileSync('preview.jpg')
235
- }
236
- })
237
254
  ```
238
255
 
239
256
  </details>
240
257
 
241
258
  <details>
242
- <summary><b>💻 Code Block Message <kbd>NEW</kbd></b></summary>
259
+ <summary><b>🖼️ Image Message</b></summary>
243
260
  <br>
244
261
 
245
- > Renders as a syntax-highlighted code block in WhatsApp (AI bot style message)
246
-
247
- **Single Code Block**
248
-
249
- ```javascript
250
- // JavaScript
251
- await sock.sendMessage(jid, {
252
- code: 'console.log("Hello World")',
253
- language: 'javascript'
254
- }, { quoted: message })
255
-
256
- // Python
262
+ ```js
263
+ // From file
257
264
  await sock.sendMessage(jid, {
258
- code: 'print("Hello World")',
259
- language: 'python'
260
- }, { quoted: message })
265
+ image: fs.readFileSync('image.jpg'),
266
+ caption: 'Caption here'
267
+ })
261
268
 
262
- // Bash / Terminal
269
+ // From URL
263
270
  await sock.sendMessage(jid, {
264
- code: stderr.trim(),
265
- language: 'bash'
266
- }, { quoted: message })
271
+ image: { url: 'https://example.com/image.jpg' },
272
+ caption: 'Downloaded image'
273
+ })
267
274
  ```
268
275
 
269
- **Multiple Code Blocks in One Message**
270
-
271
- > Gunakan key `codes` (array) untuk kirim lebih dari satu code block sekaligus dalam satu pesan
276
+ </details>
272
277
 
273
- ```javascript
274
- // 2 bahasa berbeda dalam 1 pesan
275
- await sock.sendMessage(jid, {
276
- codes: [
277
- { code: 'console.log("Hello World")', language: 'javascript' },
278
- { code: 'print("Hello World")', language: 'python' }
279
- ]
280
- }, { quoted: message })
278
+ <details>
279
+ <summary><b>🎥 Video Message</b></summary>
280
+ <br>
281
281
 
282
- // Input vs Output
282
+ ```js
283
283
  await sock.sendMessage(jid, {
284
- codes: [
285
- { code: 'SELECT * FROM users WHERE id = 1;', language: 'sql' },
286
- { code: '{ "id": 1, "name": "Ponta", "role": "admin" }', language: 'json' }
287
- ]
288
- }, { quoted: message })
284
+ video: fs.readFileSync('video.mp4'),
285
+ caption: 'Funny clip!'
286
+ })
289
287
 
290
- // Banyak snippet sekaligus
288
+ // View Once
291
289
  await sock.sendMessage(jid, {
292
- codes: [
293
- { code: 'npm install @pontasockets/baileys', language: 'bash' },
294
- { code: 'import makeWASocket from "@pontasockets/baileys"', language: 'javascript' },
295
- { code: 'const sock = makeWASocket({ printQRInTerminal: true })', language: 'javascript' }
296
- ]
297
- }, { quoted: message })
290
+ video: fs.readFileSync('secret.mp4'),
291
+ viewOnce: true
292
+ })
298
293
  ```
299
294
 
300
- > **Note:** Key `code` (single) dan `codes` (array) keduanya tetap support — tidak breaking change.
301
-
302
- **Supported Languages:**
303
-
304
- | Language | Keys |
305
- |----------|------|
306
- | JavaScript | `javascript` · `js` |
307
- | TypeScript | `typescript` · `ts` |
308
- | Python | `python` · `py` |
309
- | Bash / Shell | `bash` · `sh` · `zsh` |
310
- | Go | `go` · `golang` |
311
- | Rust | `rust` · `rs` |
312
- | C | `c` · `h` |
313
- | C++ | `cpp` · `c++` |
314
- | C# | `csharp` · `cs` |
315
- | CSS | `css` |
316
- | HTML | `html` |
317
- | PowerShell | `powershell` · `ps1` |
318
- | CMD | `cmd` · `bat` |
319
- | SQL | `sql` |
320
- | JSON | `json` |
321
-
322
295
  </details>
323
296
 
324
297
  <details>
325
- <summary><b>📊 Table Message <kbd>NEW</kbd></b></summary>
298
+ <summary><b>🎵 Audio / PTT Message</b></summary>
326
299
  <br>
327
300
 
328
- > Renders as a structured table in WhatsApp (AI bot style rich message)
329
-
330
- **Simple Table**
301
+ ```js
302
+ // Regular audio
303
+ await sock.sendMessage(jid, {
304
+ audio: fs.readFileSync('audio.mp3'),
305
+ ptt: false
306
+ })
331
307
 
332
- ```javascript
308
+ // Push-to-talk voice note
333
309
  await sock.sendMessage(jid, {
334
- table: {
335
- title: 'Daftar User',
336
- headers: ['Name', 'Role', 'Status'],
337
- rows: [
338
- ['Ponta', 'Admin', 'Active'],
339
- ['Yue', 'Member', 'Idle'],
340
- ['Frieren', 'Guest', 'Offline']
341
- ]
342
- }
343
- }, { quoted: message })
310
+ audio: fs.readFileSync('voice.ogg'),
311
+ ptt: true,
312
+ waveform: [0, 1, 0, 1, 0]
313
+ })
344
314
  ```
345
315
 
346
- **Table tanpa title**
316
+ </details>
347
317
 
348
- ```javascript
349
- await sock.sendMessage(jid, {
350
- table: {
351
- headers: ['Command', 'Description'],
352
- rows: [
353
- ['.ping', 'Cek latency bot'],
354
- ['.info', 'Info bot'],
355
- ['.help', 'List semua command']
356
- ]
357
- }
358
- }, { quoted: message })
359
- ```
318
+ <details>
319
+ <summary><b>👤 Contact Message</b></summary>
320
+ <br>
360
321
 
361
- **Table tanpa header (data only)**
322
+ ```js
323
+ const vcard = [
324
+ 'BEGIN:VCARD',
325
+ 'VERSION:3.0',
326
+ 'FN:Jeff Singh',
327
+ 'ORG:Ashoka Uni',
328
+ 'TEL;type=CELL;type=VOICE;waid=911234567890:+91 12345 67890',
329
+ 'END:VCARD'
330
+ ].join('\n')
362
331
 
363
- ```javascript
364
332
  await sock.sendMessage(jid, {
365
- table: {
366
- rows: [
367
- ['RAM', '512 MB'],
368
- ['CPU', '4 Core'],
369
- ['Uptime', '99.9%']
370
- ]
333
+ contacts: {
334
+ displayName: 'Jeff Singh',
335
+ contacts: [{ vcard }]
371
336
  }
372
- }, { quoted: message })
337
+ })
373
338
  ```
374
339
 
375
- **Mixed: Table + Code Block dalam 1 pesan**
340
+ </details>
376
341
 
377
- > Gunakan key `items` untuk gabungkan berbagai tipe dalam urutan bebas
342
+ <details>
343
+ <summary><b>📍 Location Message</b></summary>
344
+ <br>
378
345
 
379
- ```javascript
346
+ ```js
380
347
  await sock.sendMessage(jid, {
381
- items: [
382
- {
383
- table: {
384
- title: 'Query Result',
385
- headers: ['id', 'name', 'score'],
386
- rows: [
387
- ['1', 'Ponta', '98'],
388
- ['2', 'Yue', '87']
389
- ]
390
- }
391
- },
392
- { code: 'SELECT * FROM users ORDER BY score DESC', language: 'sql' }
393
- ]
394
- }, { quoted: message })
348
+ location: {
349
+ degreesLatitude: 37.422,
350
+ degreesLongitude: -122.084,
351
+ name: 'Google HQ'
352
+ }
353
+ })
395
354
  ```
396
355
 
397
- > **Note:** `items` array juga bisa diisi full code blocks saja (pengganti `codes`), atau full tables saja, atau campuran keduanya — bebas urutannya.
398
-
399
356
  </details>
400
357
 
401
358
  <details>
402
- <summary><b>📝 Rich Text Message <kbd>NEW</kbd></b></summary>
359
+ <summary><b>💥 React to Message</b></summary>
403
360
  <br>
404
361
 
405
- > Renders as AI bot markdown-style text dalam WhatsApp (gunakan `richText`, bukan `text` — supaya tidak konflik dengan text message biasa)
406
-
407
- ```javascript
408
- // Simple text
362
+ ```js
409
363
  await sock.sendMessage(jid, {
410
- richText: 'Halo! Ini adalah pesan teks rich dari bot.'
411
- }, { quoted: message })
364
+ react: { text: '👍', key: message.key }
365
+ })
412
366
 
413
- // Markdown supported (bold, italic, code inline)
367
+ // Remove reaction
414
368
  await sock.sendMessage(jid, {
415
- richText: '*Hasil eksekusi:*\nStatus: `success`\nWaktu: _120ms_'
416
- }, { quoted: message })
369
+ react: { text: '', key: message.key }
370
+ })
417
371
  ```
418
372
 
419
373
  </details>
420
374
 
421
375
  <details>
422
- <summary><b>🔀 Mixed Rich Message <kbd>NEW</kbd></b></summary>
376
+ <summary><b>📊 Poll Message</b></summary>
423
377
  <br>
424
378
 
425
- > Gabungkan text, code block, dan table dalam urutan bebas dalam satu pesan menggunakan key `items`
379
+ ```js
380
+ await sock.sendMessage(jid, {
381
+ poll: {
382
+ name: 'Favorite color?',
383
+ values: ['Red', 'Blue', 'Green'],
384
+ selectableCount: 1
385
+ }
386
+ })
387
+ ```
388
+
389
+ </details>
426
390
 
427
- **Text → Code → Text**
391
+ <details>
392
+ <summary><b>📸 Album Message</b></summary>
393
+ <br>
428
394
 
429
- ```javascript
430
- await sock.sendMessage(jid, {
431
- items: [
432
- { text: 'Contoh fungsi JavaScript:' },
433
- { code: 'function greet(name) {\n return `Hello, ${name}!`\n}', language: 'javascript' },
434
- { text: 'Panggil fungsi di atas dengan `greet("Ponta")` untuk mendapat output `Hello, Ponta!`' }
435
- ]
436
- }, { quoted: message })
395
+ ```js
396
+ await sock.sendAlbumMessage(jid, [
397
+ { image: { url: 'https://example.com/1.jpg' }, caption: 'First' },
398
+ { video: { url: 'https://example.com/clip.mp4' }, caption: 'Second' }
399
+ ], { quoted: message, delay: 3000 })
437
400
  ```
438
401
 
439
- **Text → Code → Table**
402
+ </details>
403
+
404
+ <details>
405
+ <summary><b>👨‍💻 Interactive Messages</b></summary>
406
+ <br>
407
+
408
+ <details>
409
+ <summary>Native Flow</summary>
440
410
 
441
- ```javascript
411
+ ```js
442
412
  await sock.sendMessage(jid, {
443
- items: [
444
- { text: 'Query yang dijalankan:' },
445
- { code: 'SELECT id, name, score FROM users ORDER BY score DESC LIMIT 3', language: 'sql' },
446
- { text: 'Hasil:' },
447
- {
448
- table: {
449
- headers: ['id', 'name', 'score'],
450
- rows: [
451
- ['1', 'Ponta', '98'],
452
- ['2', 'Yue', '87'],
453
- ['3', 'Frieren', '75']
454
- ]
455
- }
456
- }
457
- ]
458
- }, { quoted: message })
413
+ text: 'Choose an option:',
414
+ title: 'Title',
415
+ footer: '© PONTASOCKETS Baileys',
416
+ interactive: [{
417
+ name: 'quick_reply',
418
+ buttonParamsJson: JSON.stringify({ display_text: 'Quick Reply', id: '123' })
419
+ }]
420
+ })
459
421
  ```
460
422
 
461
- **Full mixed**
423
+ </details>
424
+
425
+ <details>
426
+ <summary>Carousel Message</summary>
462
427
 
463
- ```javascript
428
+ ```js
464
429
  await sock.sendMessage(jid, {
465
- items: [
466
- { text: '*Dokumentasi Command `.eval`*' },
467
- { text: 'Syntax:' },
468
- { code: '.eval <kode javascript>', language: 'bash' },
469
- { text: 'Contoh penggunaan:' },
470
- { code: 'return 1 + 1', language: 'javascript' },
471
- { text: 'Supported types:' },
472
- {
473
- table: {
474
- headers: ['Type', 'Contoh'],
475
- rows: [
476
- ['Expression', '2 ** 10'],
477
- ['Statement', 'let x = 5; return x'],
478
- ['Async', 'await fetch(url)']
479
- ]
480
- }
481
- },
482
- { text: '_Hanya owner yang bisa menggunakan command ini._' }
483
- ]
484
- }, { quoted: message })
430
+ text: 'Check out our collection!',
431
+ title: 'Catalog',
432
+ footer: '© PONTASOCKETS Baileys',
433
+ cards: [{
434
+ image: { url: 'https://example.com/image.jpg' },
435
+ title: 'Product Name',
436
+ body: 'Product description',
437
+ footer: '© PONTASOCKETS',
438
+ buttons: [{
439
+ name: 'quick_reply',
440
+ buttonParamsJson: JSON.stringify({ display_text: 'Select', id: '1' })
441
+ }]
442
+ }]
443
+ })
485
444
  ```
486
445
 
487
- > **Tipe yang valid di dalam `items`:**
488
- > - `{ text: 'string' }` — teks / markdown
489
- > - `{ code: 'string', language: 'string' }` — code block
490
- > - `{ table: { title?, headers?, rows } }` — tabel
446
+ </details>
491
447
 
492
448
  </details>
493
449
 
494
450
  <details>
495
- <summary><b>🔗 Inline Citation Message <kbd>NEW</kbd></b></summary>
451
+ <summary><b>📌 Pin & Keep Message</b></summary>
496
452
  <br>
497
453
 
498
- > Render teks dengan citation/footnote yang bisa diklik — mirip jawaban AI WhatsApp yang punya referensi sumber
454
+ ```js
455
+ // Pin — 24h = 86400 · 7d = 604800 · 30d = 2592000
456
+ await sock.sendMessage(jid, {
457
+ pin: { type: 1, time: 86400, key: message.key }
458
+ })
459
+
460
+ // Keep
461
+ await sock.sendMessage(jid, {
462
+ keep: { key: message.key, type: 1 }
463
+ })
464
+ ```
499
465
 
500
- **Format citation di teks:** `{{KEY}}N{{/KEY}}`
501
- - `KEY` harus cocok dengan field `key` di `inlineEntities`
502
- - `N` adalah nomor urut footnote (¹²³ atau 1 2 3)
466
+ </details>
503
467
 
504
468
  ---
505
469
 
506
- **Single citation**
470
+ ### 📍 Location + Buttons
471
+
472
+ > Location message dilengkapi list menu (native flow `single_select`) dan tombol ekstra — semua dalam satu `buttonsMessage`.
473
+
474
+ <details>
475
+ <summary><b>Location + List Menu</b></summary>
476
+ <br>
507
477
 
508
- ```javascript
478
+ ```js
509
479
  await sock.sendMessage(jid, {
510
- richResponse: [
511
- {
512
- text: 'Koperasi Merah Putih adalah inisiatif pemerintah. {{SS_0}}¹{{/SS_0}} ',
513
- inlineEntities: [{
514
- key: 'SS_0',
515
- metadata: {
516
- reference_id: 1,
517
- reference_url: 'https://example.com',
518
- reference_title: 'Judul Sumber',
519
- reference_display_name: 'Sumber',
520
- sources: [{
521
- source_type: 'THIRD_PARTY',
522
- source_display_name: 'Sumber',
523
- source_subtitle: 'example.com',
524
- source_url: 'https://example.com'
525
- }],
526
- __typename: 'GenAISearchCitationItem'
527
- }
528
- }]
529
- }
530
- ]
531
- }, { quoted: message })
480
+ buttonLocation: {
481
+ latitude: -6.2088,
482
+ longitude: 106.8456,
483
+ name: 'Kantor Pusat PontaCT',
484
+ address: 'Jl. Sudirman No. 1, Jakarta Pusat',
485
+
486
+ text: 'Temukan kami di sini:',
487
+ footer: '© PontaCT',
488
+ thumbnail: 'https://example.com/map-preview.jpg',
489
+
490
+ listButtonText: 'Pilih Layanan',
491
+ listSectionTitle: 'Layanan Tersedia',
492
+ listMenu: [
493
+ { title: 'Customer Service', description: 'Lantai 1, Senin–Jumat 08.00–17.00', id: 'cs' },
494
+ { title: 'Kasir & Pembayaran', description: 'Lantai 2, buka setiap hari', id: 'kasir' },
495
+ { title: 'Gudang & Pengiriman', description: 'Gedung B, pintu belakang', id: 'gudang' }
496
+ ]
497
+ }
498
+ })
532
499
  ```
533
500
 
534
- **Multi citation dalam satu teks**
501
+ </details>
502
+
503
+ <details>
504
+ <summary><b>Location + Extra Buttons</b></summary>
505
+ <br>
535
506
 
536
- ```javascript
507
+ ```js
537
508
  await sock.sendMessage(jid, {
538
- richResponse: [
539
- {
540
- text: 'Node.js {{SS_0}}¹{{/SS_0}} adalah runtime JavaScript. Dibuat oleh Ryan Dahl {{SS_1}}²{{/SS_1}} pada 2009.',
541
- inlineEntities: [
542
- {
543
- key: 'SS_0',
544
- metadata: {
545
- reference_id: 1,
546
- reference_url: 'https://nodejs.org',
547
- reference_title: 'Node.js Official',
548
- reference_display_name: 'nodejs.org',
549
- sources: [{
550
- source_type: 'THIRD_PARTY',
551
- source_display_name: 'nodejs.org',
552
- source_subtitle: 'nodejs.org',
553
- source_url: 'https://nodejs.org'
554
- }],
555
- __typename: 'GenAISearchCitationItem'
556
- }
557
- },
558
- {
559
- key: 'SS_1',
560
- metadata: {
561
- reference_id: 2,
562
- reference_url: 'https://wikipedia.org/wiki/Ryan_Dahl',
563
- reference_title: 'Ryan Dahl - Wikipedia',
564
- reference_display_name: 'Wikipedia',
565
- sources: [{
566
- source_type: 'THIRD_PARTY',
567
- source_display_name: 'Wikipedia',
568
- source_subtitle: 'wikipedia.org',
569
- source_url: 'https://wikipedia.org/wiki/Ryan_Dahl'
570
- }],
571
- __typename: 'GenAISearchCitationItem'
572
- }
573
- }
574
- ]
575
- }
509
+ buttonLocation: {
510
+ latitude: -6.2088,
511
+ longitude: 106.8456,
512
+ name: 'Toko PontaCT',
513
+ address: 'Jl. Kebon Sirih No. 10, Jakarta',
514
+
515
+ text: 'Kunjungi toko kami!',
516
+ footer: '© PontaCT',
517
+ thumbnail: 'https://example.com/store.jpg',
518
+
519
+ extraButtons: [
520
+ { id: 'call', displayText: '📞 Hubungi Kami' },
521
+ { id: 'whatsapp', displayText: '💬 WhatsApp' },
522
+ { id: 'maps', displayText: '🗺️ Buka di Maps' }
523
+ ]
524
+ }
525
+ })
526
+ ```
527
+
528
+ </details>
529
+
530
+ <details>
531
+ <summary><b>Location + List Menu + Extra Buttons</b></summary>
532
+ <br>
533
+
534
+ ```js
535
+ await sock.sendMessage(jid, {
536
+ buttonLocation: {
537
+ latitude: -6.2088,
538
+ longitude: 106.8456,
539
+ name: 'Plaza PontaCT',
540
+ address: 'Jl. MH Thamrin No. 5, Jakarta',
541
+
542
+ text: 'Selamat datang di pusat layanan kami.',
543
+ footer: 'Buka setiap hari 09.00–21.00',
544
+ thumbnail: 'https://example.com/plaza.jpg',
545
+
546
+ listButtonText: 'Pilih Tujuan',
547
+ listSectionTitle: 'Area Tersedia',
548
+ listMenu: [
549
+ { title: 'Food Court', description: 'Lt. 1 — lebih dari 30 tenant', id: 'food' },
550
+ { title: 'Cinema', description: 'Lt. 4 — 8 studio', id: 'cinema' },
551
+ { title: 'Customer Care', description: 'Lt. 2 — sebelah eskalator', id: 'care' }
552
+ ],
553
+
554
+ extraButtons: [
555
+ { id: 'navigate', displayText: '🧭 Navigasi' },
556
+ { id: 'promo', displayText: '🎁 Promo Hari Ini' }
557
+ ]
558
+ }
559
+ })
560
+ ```
561
+
562
+ </details>
563
+
564
+ **Fields:**
565
+
566
+ | Field | Type | Required | Default | Keterangan |
567
+ |:---|:---|:---:|:---|:---|
568
+ | `latitude` | `number` | — | `0` | Koordinat lintang |
569
+ | `longitude` | `number` | — | `0` | Koordinat bujur |
570
+ | `name` | `string` | — | `'Location'` | Nama tempat |
571
+ | `address` | `string` | — | `''` | Alamat teks |
572
+ | `text` | `string` | — | `''` | Body teks pesan |
573
+ | `footer` | `string` | — | `''` | Footer teks |
574
+ | `thumbnail` | `Buffer/URL/path` | ✅ | — | Preview peta |
575
+ | `listButtonText` | `string` | — | `'Pilih Menu'` | Label tombol list |
576
+ | `listSectionTitle` | `string` | — | `'Pilihan'` | Judul section list |
577
+ | `listMenu` | `array` | — | — | Baris-baris menu list |
578
+ | `extraButtons` | `array` | — | — | Tombol tambahan |
579
+
580
+ ---
581
+
582
+ ### 📦 Order Status
583
+
584
+ > Interactive message status pesanan menggunakan native flow `order_status` button — tampil sebagai card pesanan yang bisa diklik di WhatsApp.
585
+
586
+ <details>
587
+ <summary><b>Basic Order Status</b></summary>
588
+ <br>
589
+
590
+ ```js
591
+ await sock.sendMessage(jid, {
592
+ orderStatus: {
593
+ image: 'https://example.com/order-banner.jpg',
594
+ title: 'Status Pesanan',
595
+ text: 'Pesanan kamu sedang diproses oleh penjual.',
596
+ referenceId: 'ORD-20250629-001',
597
+ status: 'PROCESSING',
598
+ currency: 'IDR'
599
+ }
600
+ })
601
+ ```
602
+
603
+ </details>
604
+
605
+ <details>
606
+ <summary><b>Full Order Status dengan Total & Pajak</b></summary>
607
+ <br>
608
+
609
+ ```js
610
+ await sock.sendMessage(jid, {
611
+ orderStatus: {
612
+ image: 'https://example.com/order.jpg',
613
+ title: 'Update Pesanan #ORD-2025-001',
614
+ text: 'Pesananmu sedang dalam perjalanan! 🚚',
615
+ footer: 'Estimasi tiba: 2–3 hari kerja',
616
+
617
+ referenceId: 'ORD-2025-001',
618
+ status: 'SHIPPED',
619
+
620
+ // value ÷ offset = nominal asli (mis. 15000000 / 100 = 150.000,00)
621
+ subtotalValue: 15000000,
622
+ subtotalOffset: 100,
623
+ taxValue: 1500000,
624
+ taxOffset: 100,
625
+ currency: 'IDR'
626
+ }
627
+ })
628
+ ```
629
+
630
+ </details>
631
+
632
+ <details>
633
+ <summary><b>Image dari File Lokal</b></summary>
634
+ <br>
635
+
636
+ ```js
637
+ const fs = require('fs')
638
+
639
+ await sock.sendMessage(jid, {
640
+ orderStatus: {
641
+ image: fs.readFileSync('./assets/order-confirm.jpg'),
642
+ title: 'Pesanan Dikonfirmasi ✅',
643
+ text: 'Terima kasih telah berbelanja!',
644
+ referenceId: 'ORD-LOCAL-001',
645
+ status: 'PROCESSING',
646
+ currency: 'IDR'
647
+ }
648
+ })
649
+ ```
650
+
651
+ </details>
652
+
653
+ **Fields:**
654
+
655
+ | Field | Type | Required | Default | Keterangan |
656
+ |:---|:---|:---:|:---|:---|
657
+ | `image` | `Buffer/URL/path` | ✅ | — | Gambar header card |
658
+ | `title` | `string` | — | `'Order Status'` | Judul header |
659
+ | `text` | `string` | — | `'Silakan cek status pesanan Anda.'` | Body teks |
660
+ | `footer` | `string` | — | `'Powered by PontaCT'` | Footer teks |
661
+ | `referenceId` | `string` | — | `'PT-001'` | ID referensi pesanan |
662
+ | `status` | `string` | — | `'PROCESSING'` | Status pesanan |
663
+ | `subtotalValue` | `number` | — | `0` | Nilai subtotal (dalam unit offset) |
664
+ | `subtotalOffset` | `number` | — | `100` | Pembagi nilai |
665
+ | `taxValue` | `number` | — | `0` | Nilai pajak |
666
+ | `taxOffset` | `number` | — | `100` | Pembagi pajak |
667
+ | `currency` | `string` | — | `'IDR'` | Kode mata uang |
668
+
669
+ > **Status values:** `PROCESSING` · `SHIPPED` · `DELIVERED` · `CANCELLED` · `REFUNDED`
670
+
671
+ ---
672
+
673
+ ### 🤖 Rich Message <kbd>PONTASOCKETS EXCLUSIVE</kbd>
674
+
675
+ > Semua rich message dikirim via `sendMessage` standar — dirender sebagai AI bot message di WhatsApp.
676
+ > Gunakan key yang sesuai sebagai pengganti `text`, `image`, `video`, dll.
677
+
678
+ **Quick jump:**
679
+ [Rich Text](#-rich-text) · [Code Block](#-rich-code-block) · [Table](#-rich-table) · [Images](#-rich-images) · [Video](#-rich-video) · [Suggestions](#-rich-suggestions) · [LaTeX](#-rich-latex) · [Product](#-rich-product) · [Post](#-rich-post) · [Reels](#-rich-reels) · [Sources](#-rich-sources) · [Tip & Footer](#-rich-tip--footer) · [Mixed items](#-rich-mixed--items) · [richResponse](#-rich-response--richresponse)
680
+
681
+ ---
682
+
683
+ #### 📝 Rich Text
684
+
685
+ > Render teks dengan markdown style AI bot — masuk ke `richResponseMessage`.
686
+
687
+ <details>
688
+ <summary><b>Simple Text</b></summary>
689
+ <br>
690
+
691
+ ```js
692
+ await sock.sendMessage(jid, {
693
+ richText: 'Halo! Ini pesan dari bot.'
694
+ }, { quoted: message })
695
+ ```
696
+
697
+ </details>
698
+
699
+ <details>
700
+ <summary><b>Markdown (bold, italic, inline code)</b></summary>
701
+ <br>
702
+
703
+ ```js
704
+ await sock.sendMessage(jid, {
705
+ richText: '*Hasil eksekusi:*\nStatus: `success`\nWaktu: _120ms_'
706
+ }, { quoted: message })
707
+ ```
708
+
709
+ </details>
710
+
711
+ <details>
712
+ <summary><b>Multiple Paragraphs (Array)</b></summary>
713
+ <br>
714
+
715
+ ```js
716
+ await sock.sendMessage(jid, {
717
+ richText: [
718
+ 'Baris pertama.',
719
+ 'Baris kedua.',
720
+ 'Baris ketiga.'
721
+ ]
722
+ }, { quoted: message })
723
+ ```
724
+
725
+ </details>
726
+
727
+ ---
728
+
729
+ #### 💻 Rich Code Block
730
+
731
+ > Render syntax-highlighted code block. Gunakan `code` untuk satu blok, `codes` untuk banyak sekaligus.
732
+
733
+ <details>
734
+ <summary><b>Single Code Block</b></summary>
735
+ <br>
736
+
737
+ ```js
738
+ await sock.sendMessage(jid, {
739
+ code: 'console.log("Hello World")',
740
+ language: 'javascript'
741
+ }, { quoted: message })
742
+
743
+ await sock.sendMessage(jid, {
744
+ code: 'print("Hello World")',
745
+ language: 'python'
746
+ }, { quoted: message })
747
+
748
+ await sock.sendMessage(jid, {
749
+ code: 'npm install @pontasockets/baileys',
750
+ language: 'bash'
751
+ }, { quoted: message })
752
+ ```
753
+
754
+ </details>
755
+
756
+ <details>
757
+ <summary><b>Multiple Code Blocks</b></summary>
758
+ <br>
759
+
760
+ ```js
761
+ // Input vs Output
762
+ await sock.sendMessage(jid, {
763
+ codes: [
764
+ { code: 'SELECT * FROM users WHERE id = 1;', language: 'sql' },
765
+ { code: '{ "id": 1, "name": "Ponta", "role": "admin" }', language: 'json' }
766
+ ]
767
+ }, { quoted: message })
768
+
769
+ // Install guide
770
+ await sock.sendMessage(jid, {
771
+ codes: [
772
+ { code: 'npm install @pontasockets/baileys', language: 'bash' },
773
+ { code: 'import makeWASocket from "@pontasockets/baileys"', language: 'javascript' },
774
+ { code: 'const sock = makeWASocket({ printQRInTerminal: true })', language: 'javascript' }
775
+ ]
776
+ }, { quoted: message })
777
+ ```
778
+
779
+ </details>
780
+
781
+ <details>
782
+ <summary><b>Supported Languages</b></summary>
783
+ <br>
784
+
785
+ | Language | Key |
786
+ |:---|:---|
787
+ | JavaScript | `javascript` · `js` |
788
+ | TypeScript | `typescript` · `ts` |
789
+ | Python | `python` · `py` |
790
+ | Bash / Shell | `bash` · `sh` · `zsh` |
791
+ | Go | `go` · `golang` |
792
+ | Rust | `rust` · `rs` |
793
+ | C | `c` · `h` |
794
+ | C++ | `cpp` · `c++` |
795
+ | C# | `csharp` · `cs` |
796
+ | CSS | `css` |
797
+ | HTML | `html` |
798
+ | PowerShell | `powershell` · `ps1` |
799
+ | CMD | `cmd` · `bat` |
800
+ | SQL | `sql` |
801
+ | JSON | `json` |
802
+
803
+ </details>
804
+
805
+ ---
806
+
807
+ #### 📊 Rich Table
808
+
809
+ > Render tabel terstruktur dengan `title`, `headers`, dan `rows`.
810
+
811
+ <details>
812
+ <summary><b>Simple Table</b></summary>
813
+ <br>
814
+
815
+ ```js
816
+ await sock.sendMessage(jid, {
817
+ table: {
818
+ title: 'Daftar User',
819
+ headers: ['Name', 'Role', 'Status'],
820
+ rows: [
821
+ ['Ponta', 'Admin', 'Active'],
822
+ ['Yue', 'Member', 'Idle'],
823
+ ['Frieren', 'Guest', 'Offline']
824
+ ]
825
+ }
826
+ }, { quoted: message })
827
+ ```
828
+
829
+ </details>
830
+
831
+ <details>
832
+ <summary><b>Table tanpa Title</b></summary>
833
+ <br>
834
+
835
+ ```js
836
+ await sock.sendMessage(jid, {
837
+ table: {
838
+ headers: ['Command', 'Description'],
839
+ rows: [
840
+ ['.ping', 'Cek latency bot'],
841
+ ['.info', 'Info bot'],
842
+ ['.help', 'List semua command']
843
+ ]
844
+ }
845
+ }, { quoted: message })
846
+ ```
847
+
848
+ </details>
849
+
850
+ <details>
851
+ <summary><b>Table Data Only (tanpa header)</b></summary>
852
+ <br>
853
+
854
+ ```js
855
+ await sock.sendMessage(jid, {
856
+ table: {
857
+ rows: [
858
+ ['RAM', '512 MB'],
859
+ ['CPU', '4 Core'],
860
+ ['Uptime', '99.9%']
861
+ ]
862
+ }
863
+ }, { quoted: message })
864
+ ```
865
+
866
+ </details>
867
+
868
+ ---
869
+
870
+ #### 🖼️ Rich Images <kbd>NEW</kbd>
871
+
872
+ > Render gambar sebagai AI image grid. Satu URL → single image, banyak URL → carousel.
873
+
874
+ <details>
875
+ <summary><b>Single Image</b></summary>
876
+ <br>
877
+
878
+ ```js
879
+ await sock.sendMessage(jid, {
880
+ richImages: 'https://example.com/photo.jpg'
881
+ }, { quoted: message })
882
+ ```
883
+
884
+ </details>
885
+
886
+ <details>
887
+ <summary><b>Multiple Images (Grid)</b></summary>
888
+ <br>
889
+
890
+ ```js
891
+ await sock.sendMessage(jid, {
892
+ richImages: [
893
+ 'https://example.com/photo1.jpg',
894
+ 'https://example.com/photo2.jpg',
895
+ 'https://example.com/photo3.jpg'
576
896
  ]
577
897
  }, { quoted: message })
578
898
  ```
579
899
 
580
- **Citation + Code Block dalam satu pesan**
900
+ </details>
581
901
 
582
- ```javascript
902
+ <details>
903
+ <summary><b>Di dalam items / richResponse</b></summary>
904
+ <br>
905
+
906
+ ```js
907
+ // items
908
+ await sock.sendMessage(jid, {
909
+ items: [
910
+ { text: 'Hasil foto hari ini:' },
911
+ { images: ['https://example.com/1.jpg', 'https://example.com/2.jpg'] }
912
+ ]
913
+ }, { quoted: message })
914
+
915
+ // richResponse
583
916
  await sock.sendMessage(jid, {
584
917
  richResponse: [
585
- {
586
- text: 'Cara install Node.js {{SS_0}}¹{{/SS_0}}:',
587
- inlineEntities: [{
588
- key: 'SS_0',
589
- metadata: {
590
- reference_id: 1,
591
- reference_url: 'https://nodejs.org/en/download',
592
- reference_title: 'Download Node.js',
593
- reference_display_name: 'nodejs.org',
594
- sources: [{
595
- source_type: 'THIRD_PARTY',
596
- source_display_name: 'nodejs.org',
597
- source_subtitle: 'nodejs.org',
598
- source_url: 'https://nodejs.org/en/download'
599
- }],
600
- __typename: 'GenAISearchCitationItem'
601
- }
602
- }]
603
- },
604
- {
605
- code: 'curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -\napt-get install -y nodejs',
606
- language: 'bash'
607
- },
608
- {
609
- text: '_Verifikasi instalasi dengan_ `node --version`'
610
- }
918
+ { text: 'Lihat gambarnya:' },
919
+ { images: 'https://example.com/banner.jpg' }
611
920
  ]
612
921
  }, { quoted: message })
613
922
  ```
614
923
 
615
- > **Tipe yang valid di dalam `richResponse`:**
616
- > - `{ text, inlineEntities? }` — teks / markdown dengan optional citation
617
- > - `{ code, language }` — code block
618
- > - `{ table, title? }` — tabel, `table` berupa `[{ items: string[], isHeading?: bool }, ...]`
924
+ </details>
925
+
926
+ ---
927
+
928
+ #### 🎥 Rich Video <kbd>NEW</kbd>
929
+
930
+ > Embed video sebagai AI animated media (`GenAIImaginePrimitive` dengan `imagine_type: ANIMATE`).
931
+
932
+ <details>
933
+ <summary><b>Shorthand URL</b></summary>
934
+ <br>
935
+
936
+ ```js
937
+ await sock.sendMessage(jid, {
938
+ richVideo: 'https://example.com/clip.mp4'
939
+ }, { quoted: message })
940
+ ```
619
941
 
620
942
  </details>
621
943
 
944
+ <details>
945
+ <summary><b>Dengan Opsi Lengkap</b></summary>
946
+ <br>
947
+
948
+ ```js
949
+ await sock.sendMessage(jid, {
950
+ richVideo: {
951
+ url: 'https://example.com/clip.mp4',
952
+ mimeType: 'video/mp4', // default: 'video/mp4'
953
+ duration: 15, // detik, default: 10
954
+ fallbackText: 'Preview video' // default: '[ VIDEO - PontaCT ]'
955
+ }
956
+ }, { quoted: message })
957
+ ```
958
+
622
959
  </details>
623
960
 
624
961
  <details>
625
- <summary><b>🖼️ Image Message</b></summary>
962
+ <summary><b>Di dalam items / richResponse</b></summary>
626
963
  <br>
627
964
 
628
- ```javascript
629
- // From local file
965
+ ```js
966
+ // items
630
967
  await sock.sendMessage(jid, {
631
- image: fs.readFileSync('image.jpg'),
632
- caption: 'My cat!',
633
- mentions: ['1234567890@s.whatsapp.net']
634
- })
968
+ items: [
969
+ { text: 'Cek videonya:' },
970
+ { videoUrl: 'https://example.com/clip.mp4', duration: 20 }
971
+ ]
972
+ }, { quoted: message })
635
973
 
636
- // From URL
974
+ // richResponse
637
975
  await sock.sendMessage(jid, {
638
- image: { url: 'https://example.com/image.jpg' },
639
- caption: 'Downloaded image'
640
- })
976
+ richResponse: [
977
+ { text: 'Tutorial:' },
978
+ { video: { url: 'https://example.com/tutorial.mp4', duration: 30 } }
979
+ ]
980
+ }, { quoted: message })
641
981
  ```
642
982
 
643
983
  </details>
644
984
 
985
+ ---
986
+
987
+ #### 💡 Rich Suggestions <kbd>NEW</kbd>
988
+
989
+ > Render follow-up prompt pills — tombol suggestion seperti di chat AI WhatsApp.
990
+
645
991
  <details>
646
- <summary><b>🎥 Video Message</b></summary>
992
+ <summary><b>Shorthand</b></summary>
647
993
  <br>
648
994
 
649
- ```javascript
650
- // From local file
995
+ ```js
651
996
  await sock.sendMessage(jid, {
652
- video: fs.readFileSync('video.mp4'),
653
- caption: 'Funny clip!'
654
- })
997
+ richSuggestions: ['Coba lagi', 'Lihat detail', 'Batalkan']
998
+ }, { quoted: message })
999
+ ```
655
1000
 
656
- // View Once
1001
+ </details>
1002
+
1003
+ <details>
1004
+ <summary><b>Kombinasi dengan Konten</b></summary>
1005
+ <br>
1006
+
1007
+ ```js
657
1008
  await sock.sendMessage(jid, {
658
- video: fs.readFileSync('secret.mp4'),
659
- viewOnce: true
660
- })
1009
+ items: [
1010
+ { text: 'Mau lanjut ke mana?' },
1011
+ { suggestions: ['Halaman utama', 'Bantuan', 'Hubungi admin'] }
1012
+ ]
1013
+ }, { quoted: message })
661
1014
  ```
662
1015
 
663
1016
  </details>
664
1017
 
665
1018
  <details>
666
- <summary><b>🎵 Audio / PTT Message</b></summary>
1019
+ <summary><b>Di dalam richResponse</b></summary>
667
1020
  <br>
668
1021
 
669
- ```javascript
670
- // Regular audio
1022
+ ```js
671
1023
  await sock.sendMessage(jid, {
672
- audio: fs.readFileSync('audio.mp3'),
673
- ptt: false
674
- })
1024
+ richResponse: [
1025
+ { text: 'Hasil pencarian ditemukan.' },
1026
+ { suggestions: ['Tampilkan semua', 'Filter ulang', 'Export'] }
1027
+ ]
1028
+ }, { quoted: message })
1029
+ ```
675
1030
 
676
- // Push-to-talk voice note
1031
+ </details>
1032
+
1033
+ ---
1034
+
1035
+ #### 🔣 Rich LaTeX <kbd>NEW</kbd>
1036
+
1037
+ > Render formula matematika sebagai `GenAILatexItem` inline entity.
1038
+ > `url` adalah URL ke gambar rendered formula (PNG/JPG dari renderer LaTeX eksternal).
1039
+
1040
+ <details>
1041
+ <summary><b>Shorthand URL</b></summary>
1042
+ <br>
1043
+
1044
+ ```js
677
1045
  await sock.sendMessage(jid, {
678
- audio: fs.readFileSync('voice.ogg'),
679
- ptt: true,
680
- waveform: [0, 1, 0, 1, 0]
681
- })
1046
+ richLatex: 'https://latex.codecogs.com/png.latex?E%3Dmc%5E2'
1047
+ }, { quoted: message })
1048
+ ```
1049
+
1050
+ </details>
1051
+
1052
+ <details>
1053
+ <summary><b>Dengan Opsi Lengkap</b></summary>
1054
+ <br>
1055
+
1056
+ ```js
1057
+ await sock.sendMessage(jid, {
1058
+ richLatex: {
1059
+ url: 'https://latex.codecogs.com/png.latex?E%3Dmc%5E2',
1060
+ text: 'E = mc²', // label display & fallback text
1061
+ width: 120, // default: 100
1062
+ height: 60, // default: 100
1063
+ font_height: 83.33, // default: 83.33
1064
+ padding: 15 // default: 15
1065
+ }
1066
+ }, { quoted: message })
1067
+ ```
1068
+
1069
+ </details>
1070
+
1071
+ <details>
1072
+ <summary><b>Di dalam items / richResponse</b></summary>
1073
+ <br>
1074
+
1075
+ ```js
1076
+ // items
1077
+ await sock.sendMessage(jid, {
1078
+ items: [
1079
+ { text: 'Rumus energi kinetik:' },
1080
+ {
1081
+ latexUrl: 'https://latex.codecogs.com/png.latex?E_k%3D%5Cfrac%7B1%7D%7B2%7Dmv%5E2',
1082
+ latexText: 'Ek = ½mv²',
1083
+ latexWidth: 150,
1084
+ latexHeight: 60
1085
+ }
1086
+ ]
1087
+ }, { quoted: message })
1088
+
1089
+ // richResponse
1090
+ await sock.sendMessage(jid, {
1091
+ richResponse: [
1092
+ { text: 'Solusi integral:' },
1093
+ { latex: { url: 'https://latex.codecogs.com/png.latex?%5Cint%20x%5E2%20dx', text: '∫x² dx = x³/3 + C' } }
1094
+ ]
1095
+ }, { quoted: message })
1096
+ ```
1097
+
1098
+ </details>
1099
+
1100
+ ---
1101
+
1102
+ #### 🛍️ Rich Product <kbd>NEW</kbd>
1103
+
1104
+ > Render product card(s) sebagai `GenAIProductItemCardPrimitive`.
1105
+ > Object → single card · Array → horizontal scroll carousel.
1106
+
1107
+ <details>
1108
+ <summary><b>Single Product Card</b></summary>
1109
+ <br>
1110
+
1111
+ ```js
1112
+ await sock.sendMessage(jid, {
1113
+ richProduct: {
1114
+ title: 'Sepatu Adidas Samba',
1115
+ price_display_string: 'Rp 1.200.000',
1116
+ description: 'Sepatu casual ikonik, tersedia berbagai ukuran.',
1117
+ retailer_id: 'adidas_store',
1118
+ thumbnail: { url: 'https://example.com/adidas.jpg', mime_type: 'image/jpeg', width: 300, height: 300 }
1119
+ }
1120
+ }, { quoted: message })
1121
+ ```
1122
+
1123
+ </details>
1124
+
1125
+ <details>
1126
+ <summary><b>Multiple Product Carousel</b></summary>
1127
+ <br>
1128
+
1129
+ ```js
1130
+ await sock.sendMessage(jid, {
1131
+ richProduct: [
1132
+ {
1133
+ title: 'Sepatu A',
1134
+ price_display_string: 'Rp 500.000',
1135
+ thumbnail: { url: 'https://example.com/a.jpg', mime_type: 'image/jpeg', width: 300, height: 300 }
1136
+ },
1137
+ {
1138
+ title: 'Sepatu B',
1139
+ price_display_string: 'Rp 750.000',
1140
+ thumbnail: { url: 'https://example.com/b.jpg', mime_type: 'image/jpeg', width: 300, height: 300 }
1141
+ }
1142
+ ]
1143
+ }, { quoted: message })
1144
+ ```
1145
+
1146
+ </details>
1147
+
1148
+ <details>
1149
+ <summary><b>Di dalam items / richResponse</b></summary>
1150
+ <br>
1151
+
1152
+ ```js
1153
+ // items
1154
+ await sock.sendMessage(jid, {
1155
+ items: [
1156
+ { text: 'Rekomendasi produk hari ini:' },
1157
+ { product: { title: 'Produk X', price_display_string: 'Rp 99.000' } }
1158
+ ]
1159
+ }, { quoted: message })
1160
+
1161
+ // richResponse
1162
+ await sock.sendMessage(jid, {
1163
+ richResponse: [
1164
+ { text: 'Pilih produkmu:' },
1165
+ { product: [{ title: 'A' }, { title: 'B' }] }
1166
+ ]
1167
+ }, { quoted: message })
1168
+ ```
1169
+
1170
+ </details>
1171
+
1172
+ ---
1173
+
1174
+ #### 📰 Rich Post <kbd>NEW</kbd>
1175
+
1176
+ > Render post card(s) sebagai `GenAIPostPrimitive`.
1177
+ > Object → single post · Array → horizontal scroll carousel.
1178
+
1179
+ <details>
1180
+ <summary><b>Single Post</b></summary>
1181
+ <br>
1182
+
1183
+ ```js
1184
+ await sock.sendMessage(jid, {
1185
+ richPost: {
1186
+ title: 'Caption post ini',
1187
+ author_display_name: '@pontasockets',
1188
+ author_profile_image: 'https://example.com/avatar.jpg',
1189
+ media_url: 'https://example.com/post.jpg',
1190
+ timestamp: Math.floor(Date.now() / 1000)
1191
+ }
1192
+ }, { quoted: message })
1193
+ ```
1194
+
1195
+ </details>
1196
+
1197
+ <details>
1198
+ <summary><b>Multiple Posts Carousel</b></summary>
1199
+ <br>
1200
+
1201
+ ```js
1202
+ await sock.sendMessage(jid, {
1203
+ richPost: [
1204
+ { title: 'Post 1', author_display_name: '@user1', media_url: 'https://example.com/1.jpg' },
1205
+ { title: 'Post 2', author_display_name: '@user2', media_url: 'https://example.com/2.jpg' }
1206
+ ]
1207
+ }, { quoted: message })
1208
+ ```
1209
+
1210
+ </details>
1211
+
1212
+ ---
1213
+
1214
+ #### 🎬 Rich Reels <kbd>NEW</kbd>
1215
+
1216
+ > Render reels carousel sebagai `GenAIReelPrimitive` dengan `contentItemsMetadata` di proto.
1217
+ > Otomatis inject `richResponseSourcesMetadata` dengan `provider: 'PontaCT'`.
1218
+
1219
+ <details>
1220
+ <summary><b>Single Reel</b></summary>
1221
+ <br>
1222
+
1223
+ ```js
1224
+ await sock.sendMessage(jid, {
1225
+ richReels: {
1226
+ title: '@creator_name',
1227
+ profileIconUrl: 'https://example.com/avatar.jpg',
1228
+ thumbnailUrl: 'https://example.com/thumb.jpg',
1229
+ videoUrl: 'https://example.com/reel.mp4',
1230
+ reels_title: 'Judul reel ini',
1231
+ likes_count: 12400,
1232
+ shares_count: 340,
1233
+ view_count: 89000,
1234
+ reel_source: 'IG',
1235
+ is_verified: true
1236
+ }
1237
+ }, { quoted: message })
682
1238
  ```
683
1239
 
684
1240
  </details>
685
1241
 
686
1242
  <details>
687
- <summary><b>👤 Contact Message</b></summary>
1243
+ <summary><b>Multiple Reels Carousel</b></summary>
688
1244
  <br>
689
1245
 
690
- ```javascript
691
- const vcard = [
692
- 'BEGIN:VCARD',
693
- 'VERSION:3.0',
694
- 'FN:Jeff Singh',
695
- 'ORG:Ashoka Uni',
696
- 'TEL;type=CELL;type=VOICE;waid=911234567890:+91 12345 67890',
697
- 'END:VCARD'
698
- ].join('\n')
699
-
1246
+ ```js
700
1247
  await sock.sendMessage(jid, {
701
- contacts: {
702
- displayName: 'Jeff Singh',
703
- contacts: [{ vcard }]
704
- }
705
- })
1248
+ richReels: [
1249
+ {
1250
+ title: '@creator1',
1251
+ profileIconUrl: 'https://example.com/av1.jpg',
1252
+ thumbnailUrl: 'https://example.com/th1.jpg',
1253
+ videoUrl: 'https://example.com/r1.mp4',
1254
+ likes_count: 5000,
1255
+ reel_source: 'IG'
1256
+ },
1257
+ {
1258
+ title: '@creator2',
1259
+ profileIconUrl: 'https://example.com/av2.jpg',
1260
+ thumbnailUrl: 'https://example.com/th2.jpg',
1261
+ videoUrl: 'https://example.com/r2.mp4',
1262
+ likes_count: 8200,
1263
+ reel_source: 'TT'
1264
+ }
1265
+ ]
1266
+ }, { quoted: message })
706
1267
  ```
707
1268
 
708
1269
  </details>
709
1270
 
1271
+ **Fields:**
1272
+
1273
+ | Field | Type | Default | Description |
1274
+ |:---|:---|:---:|:---|
1275
+ | `title` | `string` | — | Username / creator name |
1276
+ | `profileIconUrl` | `string` | — | Avatar URL |
1277
+ | `thumbnailUrl` | `string` | — | Thumbnail cover URL |
1278
+ | `videoUrl` | `string` | — | Video source URL |
1279
+ | `reels_title` | `string` | `''` | Judul reel |
1280
+ | `likes_count` | `number` | `0` | Jumlah like |
1281
+ | `shares_count` | `number` | `0` | Jumlah share |
1282
+ | `view_count` | `number` | `0` | Jumlah views |
1283
+ | `reel_source` | `string` | `'IG'` | Platform sumber |
1284
+ | `is_verified` | `boolean` | `false` | Centang biru |
1285
+
1286
+ ---
1287
+
1288
+ #### 🔍 Rich Sources <kbd>NEW</kbd>
1289
+
1290
+ > Render daftar sumber pencarian sebagai `GenAISearchResultPrimitive` — mirip sources di jawaban AI WhatsApp.
1291
+ > Terima object lengkap **atau** format singkat `[faviconUrl, sourceUrl, displayName]`.
1292
+
710
1293
  <details>
711
- <summary><b>💥 React to Message</b></summary>
1294
+ <summary><b>Format Array Singkat</b></summary>
712
1295
  <br>
713
1296
 
714
- ```javascript
715
- // Add reaction
716
- await sock.sendMessage(jid, {
717
- react: {
718
- text: '👍',
719
- key: message.key
720
- }
721
- })
722
-
723
- // Remove reaction (empty string)
1297
+ ```js
724
1298
  await sock.sendMessage(jid, {
725
- react: {
726
- text: '',
727
- key: message.key
728
- }
729
- })
1299
+ richSources: [
1300
+ ['https://wikipedia.org/favicon.ico', 'https://wikipedia.org/wiki/Node.js', 'Wikipedia'],
1301
+ ['https://nodejs.org/favicon.ico', 'https://nodejs.org/en/docs', 'Node.js Docs'],
1302
+ ['https://github.com/favicon.ico', 'https://github.com/nodejs/node', 'GitHub']
1303
+ ]
1304
+ }, { quoted: message })
730
1305
  ```
731
1306
 
732
1307
  </details>
733
1308
 
734
1309
  <details>
735
- <summary><b>📌 Pin & Keep Message</b></summary>
1310
+ <summary><b>Format Object Lengkap</b></summary>
736
1311
  <br>
737
1312
 
738
- | Duration | Seconds |
739
- |----------|---------|
740
- | 24 Hours | `86400` |
741
- | 7 Days | `604800` |
742
- | 30 Days | `2592000` |
743
-
744
- ```javascript
745
- // Pin a message
746
- await sock.sendMessage(jid, {
747
- pin: { type: 1, time: 86400, key: message.key }
748
- })
749
-
750
- // Keep a message
1313
+ ```js
751
1314
  await sock.sendMessage(jid, {
752
- keep: { key: message.key, type: 1 }
753
- })
1315
+ richSources: [
1316
+ {
1317
+ source_type: 'THIRD_PARTY',
1318
+ source_display_name: 'Wikipedia',
1319
+ source_subtitle: 'wikipedia.org',
1320
+ source_url: 'https://wikipedia.org/wiki/Node.js',
1321
+ favicon: { url: 'https://wikipedia.org/favicon.ico', mime_type: 'image/jpeg', width: 16, height: 16 }
1322
+ }
1323
+ ]
1324
+ }, { quoted: message })
754
1325
  ```
755
1326
 
756
1327
  </details>
757
1328
 
758
1329
  <details>
759
- <summary><b>📍 Location Message</b></summary>
1330
+ <summary><b>Kombinasi (campur format)</b></summary>
760
1331
  <br>
761
1332
 
762
- ```javascript
763
- // Static location
764
- await sock.sendMessage(jid, {
765
- location: {
766
- degreesLatitude: 37.422,
767
- degreesLongitude: -122.084,
768
- name: 'Google HQ'
769
- }
770
- })
771
-
772
- // Live location
1333
+ ```js
773
1334
  await sock.sendMessage(jid, {
774
- location: {
775
- degreesLatitude: 37.422,
776
- degreesLongitude: -122.084,
777
- accuracyInMeters: 10
778
- },
779
- live: true,
780
- caption: "I'm here!"
781
- })
1335
+ richSources: [
1336
+ ['https://wikipedia.org/fav.ico', 'https://wikipedia.org', 'Wikipedia'],
1337
+ { source_type: 'THIRD_PARTY', source_display_name: 'Docs', source_url: 'https://docs.example.com' }
1338
+ ]
1339
+ }, { quoted: message })
782
1340
  ```
783
1341
 
784
1342
  </details>
785
1343
 
1344
+ ---
1345
+
1346
+ #### 📌 Rich Tip & Footer <kbd>NEW</kbd>
1347
+
1348
+ > `richTip` — metadata text kecil di atas/tengah pesan.
1349
+ > `richFooter` — metadata text di bawah pesan, biasa diisi disclaimer / branding.
1350
+
786
1351
  <details>
787
- <summary><b>📞 Call Message</b></summary>
1352
+ <summary><b>Rich Tip</b></summary>
788
1353
  <br>
789
1354
 
790
- ```javascript
791
- // Voice call
792
- await sock.sendMessage(jid, {
793
- call: { name: 'Call message', type: 1 }
794
- })
795
-
796
- // Video call
1355
+ ```js
797
1356
  await sock.sendMessage(jid, {
798
- call: { name: 'Video call', type: 2 }
799
- })
1357
+ richTip: 'Dihasilkan oleh AI · pontasockets v0.3.4'
1358
+ }, { quoted: message })
800
1359
  ```
801
1360
 
802
1361
  </details>
803
1362
 
804
1363
  <details>
805
- <summary><b>📊 Poll Message</b></summary>
1364
+ <summary><b>Rich Footer</b></summary>
806
1365
  <br>
807
1366
 
808
- ```javascript
1367
+ ```js
809
1368
  await sock.sendMessage(jid, {
810
- poll: {
811
- name: 'Favorite color?',
812
- values: ['Red', 'Blue', 'Green'],
813
- selectableCount: 1
814
- }
815
- })
1369
+ richFooter: '© 2025 PontaCT · Data bersumber dari layanan publik'
1370
+ }, { quoted: message })
816
1371
  ```
817
1372
 
818
1373
  </details>
819
1374
 
820
1375
  <details>
821
- <summary><b>📸 Album Message</b></summary>
1376
+ <summary><b>Di dalam items / richResponse</b></summary>
822
1377
  <br>
823
1378
 
824
- ```javascript
825
- await sock.sendAlbumMessage(jid, [
826
- {
827
- image: { url: 'https://example.com/image.jpg' },
828
- caption: 'First photo'
829
- },
830
- {
831
- video: { url: 'https://example.com/video.mp4' },
832
- caption: 'First video'
833
- }
834
- ], { quoted: message, delay: 3000 })
1379
+ ```js
1380
+ // items
1381
+ await sock.sendMessage(jid, {
1382
+ items: [
1383
+ { text: 'Hasil pencarian:' },
1384
+ { sources: [['https://fav.ico', 'https://example.com', 'Example']] },
1385
+ { tip: 'AI-generated content' },
1386
+ { footer: '© PontaCT Baileys' }
1387
+ ]
1388
+ }, { quoted: message })
1389
+
1390
+ // richResponse
1391
+ await sock.sendMessage(jid, {
1392
+ richResponse: [
1393
+ { text: 'Summary di sini.' },
1394
+ { footer: '© PontaCT · pontasockets' }
1395
+ ]
1396
+ }, { quoted: message })
835
1397
  ```
836
1398
 
837
1399
  </details>
838
1400
 
1401
+ ---
1402
+
1403
+ #### 🔀 Rich Mixed — `items` <kbd>NEW</kbd>
1404
+
1405
+ > Gabungkan semua tipe rich dalam urutan bebas menggunakan `items`. Urutan array = urutan tampil.
1406
+
1407
+ **Tipe valid di dalam `items`:**
1408
+
1409
+ | Key | Tipe |
1410
+ |:---|:---|
1411
+ | `{ text }` | Rich text |
1412
+ | `{ code, language }` | Code block |
1413
+ | `{ table }` | Table |
1414
+ | `{ images }` | Image grid |
1415
+ | `{ videoUrl, mimeType?, duration? }` | Video embed |
1416
+ | `{ suggestions }` | Suggestion pills |
1417
+ | `{ latexUrl, latexText?, latexWidth?, latexHeight? }` | LaTeX formula |
1418
+ | `{ product }` | Product card(s) |
1419
+ | `{ post }` | Post card(s) |
1420
+ | `{ reels }` | Reels carousel |
1421
+ | `{ sources }` | Search sources |
1422
+ | `{ tip }` | Tip metadata |
1423
+ | `{ footer }` | Footer metadata |
1424
+
839
1425
  <details>
840
- <summary><b>👥 Group Invite Message</b></summary>
1426
+ <summary><b>Text + Code + Table</b></summary>
841
1427
  <br>
842
1428
 
843
- ```javascript
1429
+ ```js
844
1430
  await sock.sendMessage(jid, {
845
- groupInvite: {
846
- jid: '123xxx@g.us',
847
- name: 'Group Name!',
848
- caption: 'Join my WhatsApp group!',
849
- code: 'xYz3yAtf...',
850
- expiration: 86400,
851
- jpegThumbnail: fs.readFileSync('preview.jpg')
852
- }
853
- })
1431
+ items: [
1432
+ { text: 'Query yang dijalankan:' },
1433
+ { code: 'SELECT id, name, score FROM users ORDER BY score DESC LIMIT 3', language: 'sql' },
1434
+ { text: 'Hasil:' },
1435
+ {
1436
+ table: {
1437
+ headers: ['id', 'name', 'score'],
1438
+ rows: [
1439
+ ['1', 'Ponta', '98'],
1440
+ ['2', 'Yue', '87'],
1441
+ ['3', 'Frieren', '75']
1442
+ ]
1443
+ }
1444
+ }
1445
+ ]
1446
+ }, { quoted: message })
854
1447
  ```
855
1448
 
856
1449
  </details>
857
1450
 
858
1451
  <details>
859
- <summary><b>👨‍💻 Interactive Messages</b></summary>
1452
+ <summary><b>Text + Images + Video + Suggestions</b></summary>
860
1453
  <br>
861
1454
 
862
- <details>
863
- <summary>Shop Flow Message</summary>
864
-
865
- ```javascript
1455
+ ```js
866
1456
  await sock.sendMessage(jid, {
867
- text: 'Here is body message',
868
- title: 'Here is title',
869
- subtitle: 'Here is subtitle',
870
- footer: '© PONTASOCKETS Baileys',
871
- viewOnce: true,
872
- shop: {
873
- surface: 1,
874
- id: 'facebook_store_name'
875
- }
876
- })
1457
+ items: [
1458
+ { text: '*Konten hari ini*' },
1459
+ { images: ['https://example.com/1.jpg', 'https://example.com/2.jpg'] },
1460
+ { videoUrl: 'https://example.com/preview.mp4', duration: 15 },
1461
+ { suggestions: ['Lihat selengkapnya', 'Bagikan', 'Simpan'] }
1462
+ ]
1463
+ }, { quoted: message })
877
1464
  ```
878
1465
 
879
1466
  </details>
880
1467
 
881
1468
  <details>
882
- <summary>Native Flow Message</summary>
883
-
884
- ```javascript
885
- const buttons = [{
886
- name: 'quick_reply',
887
- buttonParamsJson: JSON.stringify({
888
- display_text: 'Quick Reply',
889
- id: '123'
890
- })
891
- }]
1469
+ <summary><b>Full Mixed (semua tipe)</b></summary>
1470
+ <br>
892
1471
 
1472
+ ```js
893
1473
  await sock.sendMessage(jid, {
894
- text: 'Choose an option:',
895
- title: 'Title',
896
- footer: '© PONTASOCKETS Baileys',
897
- interactive: buttons
898
- })
1474
+ items: [
1475
+ { text: '*Laporan Harian Bot*' },
1476
+ { table: { headers: ['Metric', 'Value'], rows: [['Uptime', '99.9%'], ['Messages', '1.2K']] } },
1477
+ { code: 'SELECT COUNT(*) FROM messages WHERE date = CURDATE()', language: 'sql' },
1478
+ { text: 'Formula uptime:' },
1479
+ {
1480
+ latexUrl: 'https://latex.codecogs.com/png.latex?U%3D%5Cfrac%7Bt_u%7D%7Bt_t%7D%5Ctimes100',
1481
+ latexText: 'U = (tu/tt) × 100'
1482
+ },
1483
+ { sources: [['https://example.com/fav.ico', 'https://example.com', 'Dashboard']] },
1484
+ { suggestions: ['Refresh', 'Export PDF'] },
1485
+ { footer: 'Auto-generated · PontaCT' }
1486
+ ]
1487
+ }, { quoted: message })
899
1488
  ```
900
1489
 
901
1490
  </details>
902
1491
 
1492
+ ---
1493
+
1494
+ #### 🔗 Rich Response — `richResponse`
1495
+
1496
+ > Mode array lengkap — mendukung semua tipe termasuk inline citation dengan `inlineEntities`.
1497
+
1498
+ **Tipe valid di dalam `richResponse`:**
1499
+
1500
+ | Key | Tipe |
1501
+ |:---|:---|
1502
+ | `{ text, inlineEntities? }` | Text + optional citation/hyperlink |
1503
+ | `{ code, language }` | Code block |
1504
+ | `{ table, title? }` | Table |
1505
+ | `{ images }` | Image grid |
1506
+ | `{ video }` | Video embed |
1507
+ | `{ suggestions }` | Suggestion pills |
1508
+ | `{ latex }` | LaTeX formula |
1509
+ | `{ product }` | Product card(s) |
1510
+ | `{ post }` | Post card(s) |
1511
+ | `{ reels }` | Reels carousel |
1512
+ | `{ sources }` | Search sources |
1513
+ | `{ tip }` | Tip metadata |
1514
+ | `{ footer }` | Footer metadata |
1515
+
903
1516
  <details>
904
- <summary>Carousel Message</summary>
1517
+ <summary><b>Inline Citation</b></summary>
1518
+ <br>
905
1519
 
906
- ```javascript
1520
+ ```js
907
1521
  await sock.sendMessage(jid, {
908
- text: 'Check out our collection!',
909
- title: 'Catalog',
910
- footer: '© PONTASOCKETS Baileys',
911
- cards: [{
912
- image: { url: 'https://example.com/image.jpg' },
913
- title: 'Product Name',
914
- body: 'Product description here',
915
- footer: '© PONTASOCKETS',
916
- buttons: [{
917
- name: 'quick_reply',
918
- buttonParamsJson: JSON.stringify({
919
- display_text: 'Select',
920
- id: '123'
921
- })
922
- }]
923
- }]
924
- })
1522
+ richResponse: [
1523
+ {
1524
+ text: 'Node.js {{SS_0}}¹{{/SS_0}} adalah runtime JavaScript. Dibuat oleh Ryan Dahl {{SS_1}}²{{/SS_1}} pada 2009.',
1525
+ inlineEntities: [
1526
+ {
1527
+ key: 'SS_0',
1528
+ metadata: {
1529
+ reference_id: 1,
1530
+ reference_url: 'https://nodejs.org',
1531
+ reference_title: 'Node.js Official',
1532
+ reference_display_name: 'nodejs.org',
1533
+ sources: [{
1534
+ source_type: 'THIRD_PARTY',
1535
+ source_display_name: 'nodejs.org',
1536
+ source_subtitle: 'nodejs.org',
1537
+ source_url: 'https://nodejs.org'
1538
+ }],
1539
+ __typename: 'GenAISearchCitationItem'
1540
+ }
1541
+ },
1542
+ {
1543
+ key: 'SS_1',
1544
+ metadata: {
1545
+ reference_id: 2,
1546
+ reference_url: 'https://wikipedia.org/wiki/Ryan_Dahl',
1547
+ reference_title: 'Ryan Dahl - Wikipedia',
1548
+ reference_display_name: 'Wikipedia',
1549
+ sources: [{
1550
+ source_type: 'THIRD_PARTY',
1551
+ source_display_name: 'Wikipedia',
1552
+ source_subtitle: 'wikipedia.org',
1553
+ source_url: 'https://wikipedia.org/wiki/Ryan_Dahl'
1554
+ }],
1555
+ __typename: 'GenAISearchCitationItem'
1556
+ }
1557
+ }
1558
+ ]
1559
+ }
1560
+ ]
1561
+ }, { quoted: message })
925
1562
  ```
926
1563
 
927
1564
  </details>
928
1565
 
929
- </details>
930
-
931
1566
  <details>
932
- <summary><b>🎭 List Message</b></summary>
1567
+ <summary><b>Full Response — semua tipe sekaligus</b></summary>
933
1568
  <br>
934
1569
 
935
- ```javascript
1570
+ ```js
936
1571
  await sock.sendMessage(jid, {
937
- text: 'Choose from the menu:',
938
- sections: [{
939
- title: 'Food Menu',
940
- rows: [
941
- { title: 'Pizza', rowId: 'pizza', description: 'Cheese & pepperoni' },
942
- { title: 'Burger', rowId: 'burger', description: 'Double patty' }
943
- ]
944
- }],
945
- buttonText: 'Browse Menu'
946
- })
1572
+ richResponse: [
1573
+ { text: '*Hasil Pencarian:* Node.js {{SS_0}}¹{{/SS_0}}', inlineEntities: [/* ... */] },
1574
+ { images: ['https://example.com/nodejs.png'] },
1575
+ { text: 'Cara install:' },
1576
+ { code: 'npm install node', language: 'bash' },
1577
+ { table: { headers: ['Version', 'LTS', 'Release'], rows: [['22.x', 'Yes', '2024'], ['21.x', 'No', '2023']] } },
1578
+ { sources: [['https://nodejs.org/fav.ico', 'https://nodejs.org', 'Node.js']] },
1579
+ { suggestions: ['Lihat changelog', 'Download', 'Docs'] },
1580
+ { footer: 'PontaCT · pontasockets' }
1581
+ ]
1582
+ }, { quoted: message })
947
1583
  ```
948
1584
 
949
1585
  </details>
950
1586
 
951
1587
  ---
952
1588
 
953
- ### 📣 Newsletter
1589
+ ## 📣 Newsletter
954
1590
 
955
1591
  <details>
956
1592
  <summary><b>📋 Get Newsletter Metadata</b></summary>
957
1593
  <br>
958
1594
 
959
- ```javascript
1595
+ ```js
960
1596
  // By invite code
961
1597
  const newsletter = await sock.newsletterMetadata('invite', '0029Vaf0HPMLdQeZsp3XRp2T')
962
1598
 
963
1599
  // By JID
964
1600
  const newsletter = await sock.newsletterMetadata('jid', '120363282083849178@newsletter')
965
-
966
- console.log(newsletter)
967
1601
  ```
968
1602
 
969
1603
  </details>
@@ -972,7 +1606,7 @@ console.log(newsletter)
972
1606
  <summary><b>👆 Follow / Unfollow / Mute / Unmute</b></summary>
973
1607
  <br>
974
1608
 
975
- ```javascript
1609
+ ```js
976
1610
  const nlJid = '120363282083849178@newsletter'
977
1611
 
978
1612
  await sock.newsletterFollow(nlJid)
@@ -987,14 +1621,12 @@ await sock.newsletterUnmute(nlJid)
987
1621
  <summary><b>📣 Create Newsletter</b></summary>
988
1622
  <br>
989
1623
 
990
- ```javascript
1624
+ ```js
991
1625
  const newsletter = await sock.newsletterCreate(
992
1626
  'Newsletter Name',
993
1627
  'Description here',
994
1628
  { url: 'https://example.com/image.jpg' }
995
1629
  )
996
-
997
- console.log('Created:', newsletter)
998
1630
  ```
999
1631
 
1000
1632
  </details>
@@ -1003,11 +1635,11 @@ console.log('Created:', newsletter)
1003
1635
  <summary><b>🌟 React to Newsletter Post</b></summary>
1004
1636
  <br>
1005
1637
 
1006
- ```javascript
1638
+ ```js
1007
1639
  await sock.newsletterReactMessage(
1008
1640
  '120363282083849178@newsletter',
1009
- '12', // message server ID
1010
- '🦖' // emoji reaction
1641
+ '12', // server message ID
1642
+ '🦖' // emoji
1011
1643
  )
1012
1644
  ```
1013
1645
 
@@ -1015,13 +1647,13 @@ await sock.newsletterReactMessage(
1015
1647
 
1016
1648
  ---
1017
1649
 
1018
- ### 🛠️ Groups
1650
+ ## 👥 Groups
1019
1651
 
1020
1652
  <details>
1021
1653
  <summary><b>🔄 Create Group</b></summary>
1022
1654
  <br>
1023
1655
 
1024
- ```javascript
1656
+ ```js
1025
1657
  const group = await sock.groupCreate('Group Title', [
1026
1658
  '1234567890@s.whatsapp.net',
1027
1659
  '0987654321@s.whatsapp.net'
@@ -1036,20 +1668,13 @@ console.log('Group JID:', group.id)
1036
1668
  <summary><b>⚙️ Group Settings</b></summary>
1037
1669
  <br>
1038
1670
 
1039
- ```javascript
1671
+ ```js
1040
1672
  const jid = '123456789@g.us'
1041
1673
 
1042
- // Restrict: only admins can send messages
1043
- await sock.groupSettingUpdate(jid, 'announcement')
1044
-
1045
- // Open: everyone can send messages
1046
- await sock.groupSettingUpdate(jid, 'not_announcement')
1047
-
1048
- // Lock: only admins can edit group info
1049
- await sock.groupSettingUpdate(jid, 'locked')
1050
-
1051
- // Unlock: everyone can edit group info
1052
- await sock.groupSettingUpdate(jid, 'unlocked')
1674
+ await sock.groupSettingUpdate(jid, 'announcement') // hanya admin yang bisa kirim pesan
1675
+ await sock.groupSettingUpdate(jid, 'not_announcement') // semua anggota bisa kirim pesan
1676
+ await sock.groupSettingUpdate(jid, 'locked') // hanya admin yang bisa edit info grup
1677
+ await sock.groupSettingUpdate(jid, 'unlocked') // semua anggota bisa edit info grup
1053
1678
  ```
1054
1679
 
1055
1680
  </details>
@@ -1058,7 +1683,7 @@ await sock.groupSettingUpdate(jid, 'unlocked')
1058
1683
  <summary><b>💯 Add / Remove / Promote / Demote</b></summary>
1059
1684
  <br>
1060
1685
 
1061
- ```javascript
1686
+ ```js
1062
1687
  const participants = ['1234567890@s.whatsapp.net']
1063
1688
 
1064
1689
  await sock.groupParticipantsUpdate(jid, participants, 'add')
@@ -1073,14 +1698,12 @@ await sock.groupParticipantsUpdate(jid, participants, 'demote')
1073
1698
  <summary><b>🔗 Invite Link</b></summary>
1074
1699
  <br>
1075
1700
 
1076
- ```javascript
1077
- // Get invite code
1701
+ ```js
1078
1702
  const code = await sock.groupInviteCode(jid)
1079
1703
  console.log('Link: https://chat.whatsapp.com/' + code)
1080
1704
 
1081
- // Revoke and regenerate
1705
+ // Revoke & generate new link
1082
1706
  const newCode = await sock.groupRevokeInvite(jid)
1083
- console.log('New link: https://chat.whatsapp.com/' + newCode)
1084
1707
  ```
1085
1708
 
1086
1709
  </details>
@@ -1089,29 +1712,93 @@ console.log('New link: https://chat.whatsapp.com/' + newCode)
1089
1712
  <summary><b>📋 Group Metadata</b></summary>
1090
1713
  <br>
1091
1714
 
1092
- ```javascript
1715
+ ```js
1093
1716
  const metadata = await sock.groupMetadata(jid)
1094
-
1095
1717
  console.log('Name:', metadata.subject)
1096
- console.log('Description:', metadata.desc)
1097
1718
  console.log('Participants:', metadata.participants.length)
1098
1719
  ```
1099
1720
 
1100
1721
  </details>
1101
1722
 
1723
+ <details>
1724
+ <summary><b>📢 Group Status <kbd>NEW</kbd></b></summary>
1725
+ <br>
1726
+
1727
+ > Kirim status ke grup (`groupStatusMessageV2`) dengan kontrol audiens dan styling.
1728
+ > `message` bisa berupa `string` teks atau object message yang sudah disiapkan.
1729
+
1730
+ <details>
1731
+ <summary>Text Status</summary>
1732
+
1733
+ ```js
1734
+ await sock.sendMessage(jid, {
1735
+ groupStatus: {
1736
+ message: 'Selamat datang di grup PontaCT! 🎉',
1737
+ audienceType: 0 // 0 = semua anggota
1738
+ }
1739
+ })
1740
+ ```
1741
+
1742
+ </details>
1743
+
1744
+ <details>
1745
+ <summary>Text Status dengan Warna & Font</summary>
1746
+
1747
+ ```js
1748
+ await sock.sendMessage(jid, {
1749
+ groupStatus: {
1750
+ message: 'Bot aktif kembali! ✅',
1751
+ audienceType: 0,
1752
+ backgroundArgb: 0xFF1A1A2E, // warna background (ARGB hex)
1753
+ textArgb: 0xFFFFFFFF, // warna teks
1754
+ font: 4 // font style 0–9
1755
+ }
1756
+ })
1757
+ ```
1758
+
1759
+ </details>
1760
+
1761
+ <details>
1762
+ <summary>Media Status (image / video / audio / document)</summary>
1763
+
1764
+ ```js
1765
+ const { imageMessage } = await prepareWAMessageMedia(
1766
+ { image: { url: 'https://example.com/banner.jpg' } },
1767
+ { upload: sock.waUploadToServer }
1768
+ )
1769
+
1770
+ await sock.sendMessage(jid, {
1771
+ groupStatus: {
1772
+ message: { imageMessage },
1773
+ audienceType: 0
1774
+ }
1775
+ })
1776
+ ```
1777
+
1778
+ </details>
1779
+
1780
+ **Fields:**
1781
+
1782
+ | Field | Type | Required | Default | Keterangan |
1783
+ |:---|:---|:---:|:---|:---|
1784
+ | `message` | `string / object` | ✅ | — | Konten status (string atau WAMessage object) |
1785
+ | `audienceType` | `number` | — | `0` | Target audiens (0 = semua) |
1786
+ | `backgroundArgb` | `number` | — | — | Warna background ARGB (hanya untuk teks) |
1787
+ | `textArgb` | `number` | — | — | Warna teks (hanya untuk teks) |
1788
+ | `font` | `number` | — | — | Font style 0–9 (hanya untuk teks) |
1789
+
1790
+ </details>
1791
+
1102
1792
  ---
1103
1793
 
1104
- ### 🔒 Privacy
1794
+ ## 🔒 Privacy
1105
1795
 
1106
1796
  <details>
1107
1797
  <summary><b>🖼️ Update Profile Picture</b></summary>
1108
1798
  <br>
1109
1799
 
1110
- ```javascript
1111
- // Set new picture
1800
+ ```js
1112
1801
  await sock.updateProfilePicture(jid, { url: 'https://example.com/image.jpg' })
1113
-
1114
- // Remove picture
1115
1802
  await sock.removeProfilePicture(jid)
1116
1803
  ```
1117
1804
 
@@ -1121,7 +1808,7 @@ await sock.removeProfilePicture(jid)
1121
1808
  <summary><b>🚫 Block / Unblock</b></summary>
1122
1809
  <br>
1123
1810
 
1124
- ```javascript
1811
+ ```js
1125
1812
  await sock.updateBlockStatus(jid, 'block')
1126
1813
  await sock.updateBlockStatus(jid, 'unblock')
1127
1814
  ```
@@ -1132,39 +1819,28 @@ await sock.updateBlockStatus(jid, 'unblock')
1132
1819
  <summary><b>👁️ Privacy Settings</b></summary>
1133
1820
  <br>
1134
1821
 
1135
- ```javascript
1136
- // Last seen visibility
1137
- await sock.updateLastSeenPrivacy('all') // "all" | "contacts" | "none"
1138
-
1139
- // Online status visibility
1140
- await sock.updateOnlinePrivacy('all') // "all" | "match_last_seen"
1141
-
1142
- // Profile picture visibility
1143
- await sock.updateProfilePicturePrivacy('all') // "all" | "contacts" | "none"
1144
-
1145
- // Read receipts
1146
- await sock.updateReadReceiptsPrivacy('all') // "all" | "none"
1147
-
1148
- // Who can add to groups
1149
- await sock.updateGroupsAddPrivacy('all') // "all" | "contacts"
1150
-
1151
- // Default disappearing message timer
1152
- await sock.updateDefaultDisappearingMode(86400) // 0 to disable
1822
+ ```js
1823
+ await sock.updateLastSeenPrivacy('all') // 'all' | 'contacts' | 'none'
1824
+ await sock.updateOnlinePrivacy('all') // 'all' | 'match_last_seen'
1825
+ await sock.updateProfilePicturePrivacy('all') // 'all' | 'contacts' | 'none'
1826
+ await sock.updateReadReceiptsPrivacy('all') // 'all' | 'none'
1827
+ await sock.updateGroupsAddPrivacy('all') // 'all' | 'contacts'
1828
+ await sock.updateDefaultDisappearingMode(86400) // 0 = disable
1153
1829
  ```
1154
1830
 
1155
1831
  </details>
1156
1832
 
1157
1833
  ---
1158
1834
 
1159
- ### ⚙️ Advanced
1835
+ ## ⚙️ Advanced
1160
1836
 
1161
1837
  <details>
1162
1838
  <summary><b>🔧 Debug Logging</b></summary>
1163
1839
  <br>
1164
1840
 
1165
- ```javascript
1841
+ ```js
1166
1842
  const sock = makeWASocket({
1167
- logger: { level: 'debug' }, // "fatal" | "error" | "warn" | "info" | "debug" | "trace"
1843
+ logger: { level: 'debug' }, // 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace'
1168
1844
  auth: state
1169
1845
  })
1170
1846
  ```
@@ -1175,7 +1851,7 @@ const sock = makeWASocket({
1175
1851
  <summary><b>📡 Raw WebSocket Events</b></summary>
1176
1852
  <br>
1177
1853
 
1178
- ```javascript
1854
+ ```js
1179
1855
  sock.ws.on('CB:presence', (json) => {
1180
1856
  console.log('Presence update:', json)
1181
1857
  })
@@ -1192,51 +1868,49 @@ sock.ws.on('CB:edge_routing', (node) => {
1192
1868
  ## ⚡ Contact
1193
1869
 
1194
1870
  | Platform | Link |
1195
- |----------|------|
1871
+ |:---|:---|
1196
1872
  | 💬 Telegram | [@pontact](https://t.me/pontact) |
1197
- | 📢 Channel | [WhatsApp Channel](https://whatsapp.com/channel/0029VagslooA89MdSX0d1X1z) |
1873
+ | 📢 Channel | [WhatsApp Channel](#) |
1198
1874
  | 🌐 Rest API | [api.codeteam.web.id](https://api.codeteam.web.id) |
1199
1875
 
1200
1876
  ---
1201
1877
 
1202
1878
  ## 🤝 Contributing
1203
1879
 
1204
- Contributions are welcome and appreciated!
1205
-
1206
- 1. **Fork** the repository
1207
- 2. **Create** a feature branch → `git checkout -b feat/your-feature`
1208
- 3. **Commit** your changes → `git commit -m "feat: add something awesome"`
1209
- 4. **Push** to your branch → `git push origin feat/your-feature`
1210
- 5. **Open** a Pull Request with a clear description
1211
-
1212
- All PRs are reviewed before merging.
1880
+ 1. Fork the repository
1881
+ 2. Create a feature branch → `git checkout -b feat/your-feature`
1882
+ 3. Commit your changes → `git commit -m "feat: add something awesome"`
1883
+ 4. Push to your branch → `git push origin feat/your-feature`
1884
+ 5. Open a Pull Request
1213
1885
 
1214
1886
  ---
1215
1887
 
1216
1888
  ## 📜 License
1217
1889
 
1218
- This project is licensed for **personal and non-commercial use only**.
1890
+ This project is licensed for personal and non-commercial use only.
1219
1891
 
1220
- - Personal use and modification allowed
1221
- - ✅ Redistribution with attribution allowed
1222
- - Commercial use strictly prohibited
1223
- - Resale or rebranding prohibited
1892
+ | | |
1893
+ |:---:|:---|
1894
+ | | Personal use and modification allowed |
1895
+ | | Redistribution with attribution allowed |
1896
+ | ❌ | Commercial use strictly prohibited |
1897
+ | ❌ | Resale or rebranding prohibited |
1224
1898
 
1225
1899
  ---
1226
1900
 
1227
1901
  ## ⚠️ Disclaimer
1228
1902
 
1229
- > This project is **not affiliated** with WhatsApp or Meta in any way.
1230
- > Use at your own risk and refer to [WhatsApp's Terms of Service](https://www.whatsapp.com/legal) for compliance.
1903
+ > This project is not affiliated with WhatsApp or Meta in any way.
1904
+ > Use at your own risk and refer to WhatsApp's [Terms of Service](https://www.whatsapp.com/legal/terms-of-service) for compliance.
1231
1905
 
1232
1906
  ---
1233
1907
 
1234
1908
  <div align="center">
1235
1909
 
1236
- **[📦 NPM](https://npmjs.com/package/@pontasockets/baileys)** · **[📖 Baileys Wiki](https://github.com/whiskeysockets/baileys/wiki)** · **[⭐ Star this repo](https://github.com/pontasockets/baileys)**
1910
+ [📦 NPM](https://www.npmjs.com/package/@pontasockets/baileys) · [📖 Baileys Wiki](https://github.com/WhiskeySockets/Baileys/wiki) · [⭐ Star this repo](#)
1237
1911
 
1238
1912
  <br>
1239
1913
 
1240
- *Made with ♥ by PONTASOCKETS*
1914
+ Made with ♥ by **PontaCT**
1241
1915
 
1242
1916
  </div>