@pontalabs/baileys 1.2.9 โ 1.2.10
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 +195 -59
- package/WAProto/CHANGES-2.26.47.10.md +422 -0
- package/WAProto/WAProto.proto +1250 -4
- package/lib/Types/Message.d.ts +59 -1
- package/lib/Utils/beta-messages.d.ts +5 -0
- package/lib/Utils/beta-messages.js +133 -0
- package/lib/Utils/index.d.ts +1 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/mbuilder.js +6 -0
- package/lib/Utils/messages.js +16 -0
- package/lib/Utils/rich-message-utils.d.ts +8 -0
- package/lib/Utils/rich-message-utils.js +26 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -207,6 +207,17 @@ await sock.sendMessage(jid, { text: 'Reply!' }, { quoted: message })
|
|
|
207
207
|
```
|
|
208
208
|
</details>
|
|
209
209
|
|
|
210
|
+
<details>
|
|
211
|
+
<summary><b>โณ After-Read Timer</b></summary>
|
|
212
|
+
|
|
213
|
+
```js
|
|
214
|
+
await sock.sendMessage(jid, { text: 'Pesan sementara', afterReadDuration: 60 })
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
> `afterReadDuration` is in seconds and works with any message type.
|
|
218
|
+
|
|
219
|
+
</details>
|
|
220
|
+
|
|
210
221
|
<details>
|
|
211
222
|
<summary><b>๐ผ๏ธ Image</b></summary>
|
|
212
223
|
|
|
@@ -242,6 +253,29 @@ await sock.sendMessage(jid, {
|
|
|
242
253
|
```
|
|
243
254
|
</details>
|
|
244
255
|
|
|
256
|
+
<details>
|
|
257
|
+
<summary><b>โก Instant Image / Video</b></summary>
|
|
258
|
+
|
|
259
|
+
```js
|
|
260
|
+
await sock.sendMessage(jid, { instantImage: { url: './foto.jpg' }, caption: 'Instan' })
|
|
261
|
+
await sock.sendMessage(jid, { instantVideo: { url: './klip.mp4' }, caption: 'Instan' })
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
</details>
|
|
265
|
+
|
|
266
|
+
<details>
|
|
267
|
+
<summary><b>๐ Spoiler</b></summary>
|
|
268
|
+
|
|
269
|
+
```js
|
|
270
|
+
await sock.sendMessage(jid, {
|
|
271
|
+
image: { url: './foto.jpg' },
|
|
272
|
+
caption: 'Awas spoiler',
|
|
273
|
+
spoiler: true
|
|
274
|
+
})
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
</details>
|
|
278
|
+
|
|
245
279
|
<details>
|
|
246
280
|
<summary><b>๐ต Audio / PTT</b></summary>
|
|
247
281
|
|
|
@@ -258,6 +292,40 @@ await sock.sendMessage(jid, {
|
|
|
258
292
|
```
|
|
259
293
|
</details>
|
|
260
294
|
|
|
295
|
+
<details>
|
|
296
|
+
<summary><b>๐งท Audio Sticker</b></summary>
|
|
297
|
+
|
|
298
|
+
```js
|
|
299
|
+
await sock.sendMessage(jid, {
|
|
300
|
+
audioSticker: {
|
|
301
|
+
sticker: { url: './stiker.webp' },
|
|
302
|
+
audio: { url: './suara.mp4' }
|
|
303
|
+
}
|
|
304
|
+
})
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
</details>
|
|
308
|
+
|
|
309
|
+
<details>
|
|
310
|
+
<summary><b>๐ถ Music</b></summary>
|
|
311
|
+
|
|
312
|
+
```js
|
|
313
|
+
await sock.sendMessage(jid, {
|
|
314
|
+
music: {
|
|
315
|
+
songUri: 'https://example.com/song.mp3',
|
|
316
|
+
artworkUri: 'https://example.com/cover.jpg',
|
|
317
|
+
lyrics: [
|
|
318
|
+
{ start: 0, end: 2500, text: 'Baris pertama' },
|
|
319
|
+
{ start: 2500, end: 5000, text: 'Baris kedua' }
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
})
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
> `lyrics` is optional. Each line takes `start` / `end` in milliseconds and an optional `words` array (`startIndex`, `endIndex`, `start`, `end`) for word-level sync.
|
|
326
|
+
|
|
327
|
+
</details>
|
|
328
|
+
|
|
261
329
|
<details>
|
|
262
330
|
<summary><b>๐ค Contact</b></summary>
|
|
263
331
|
|
|
@@ -288,6 +356,16 @@ await sock.sendMessage(jid, {
|
|
|
288
356
|
```
|
|
289
357
|
</details>
|
|
290
358
|
|
|
359
|
+
<details>
|
|
360
|
+
<summary><b>๐ฐ๏ธ Request Location</b></summary>
|
|
361
|
+
|
|
362
|
+
```js
|
|
363
|
+
await sock.sendMessage(jid, { requestLocation: true })
|
|
364
|
+
await sock.sendMessage(jid, { requestLocationUpdate: message.key })
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
</details>
|
|
368
|
+
|
|
291
369
|
<details>
|
|
292
370
|
<summary><b>๐ฅ React</b></summary>
|
|
293
371
|
|
|
@@ -334,6 +412,20 @@ await sock.sendMessage(jid, {
|
|
|
334
412
|
}
|
|
335
413
|
})
|
|
336
414
|
```
|
|
415
|
+
|
|
416
|
+
**Poll options**
|
|
417
|
+
|
|
418
|
+
```js
|
|
419
|
+
await sock.sendMessage(jid, {
|
|
420
|
+
poll: {
|
|
421
|
+
name: 'Makan apa?',
|
|
422
|
+
values: ['Nasi', 'Mie'],
|
|
423
|
+
selectableCount: 1,
|
|
424
|
+
hideVoter: true,
|
|
425
|
+
canAddOption: true
|
|
426
|
+
}
|
|
427
|
+
})
|
|
428
|
+
```
|
|
337
429
|
</details>
|
|
338
430
|
|
|
339
431
|
<details>
|
|
@@ -378,6 +470,26 @@ await sock.sendMessage(jid, {
|
|
|
378
470
|
```
|
|
379
471
|
</details>
|
|
380
472
|
|
|
473
|
+
<details>
|
|
474
|
+
<summary><b>๐จ Event Invite</b></summary>
|
|
475
|
+
|
|
476
|
+
```js
|
|
477
|
+
await sock.sendMessage(jid, {
|
|
478
|
+
eventInvite: {
|
|
479
|
+
eventId: 'ID_PESAN_EVENT',
|
|
480
|
+
title: 'Rapat Mingguan',
|
|
481
|
+
startDate: new Date('2026-12-01T09:00:00+07:00'),
|
|
482
|
+
endDate: new Date('2026-12-01T10:00:00+07:00'),
|
|
483
|
+
location: 'Ruang Meeting',
|
|
484
|
+
caption: 'Jangan telat'
|
|
485
|
+
}
|
|
486
|
+
})
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
> `eventId` is the message ID of an existing event.
|
|
490
|
+
|
|
491
|
+
</details>
|
|
492
|
+
|
|
381
493
|
<details>
|
|
382
494
|
<summary><b>๐จโ๐ป Interactive (Native Flow & Carousel)</b></summary>
|
|
383
495
|
|
|
@@ -510,6 +622,19 @@ await sock.sendMessage(jid, { keep: { key: message.key, type: 1 } })
|
|
|
510
622
|
```
|
|
511
623
|
</details>
|
|
512
624
|
|
|
625
|
+
<details>
|
|
626
|
+
<summary><b>๐งฉ Raw Message Field</b></summary>
|
|
627
|
+
|
|
628
|
+
```js
|
|
629
|
+
await sock.sendMessage(jid, {
|
|
630
|
+
beta: { pollAddOptionMessage: { /* fields from WAProto */ } }
|
|
631
|
+
})
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
> Accepts any `*Message` / `*Metadata` field of `proto.Message`. Payment, encryption-key and internal control messages are rejected.
|
|
635
|
+
|
|
636
|
+
</details>
|
|
637
|
+
|
|
513
638
|
---
|
|
514
639
|
|
|
515
640
|
### ๐ Location + Buttons
|
|
@@ -596,19 +721,17 @@ await sock.sendMessage(jid, {
|
|
|
596
721
|
<details>
|
|
597
722
|
<summary><b>๐ Fields Reference</b></summary>
|
|
598
723
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
| `listMenu` | `array` | โ | โ | Menu rows |
|
|
611
|
-
| `extraButtons` | `array` | โ | โ | Extra buttons |
|
|
724
|
+
- `latitude` (`number`) โ Latitude coordinate _(default `0`)_
|
|
725
|
+
- `longitude` (`number`) โ Longitude coordinate _(default `0`)_
|
|
726
|
+
- `name` (`string`) โ Place name _(default `'Location'`)_
|
|
727
|
+
- `address` (`string`) โ Text address _(default `''`)_
|
|
728
|
+
- `text` (`string`) โ Message body text _(default `''`)_
|
|
729
|
+
- `footer` (`string`) โ Footer text _(default `''`)_
|
|
730
|
+
- `thumbnail` (`Buffer / URL / path`) โ Map preview image _(required)_
|
|
731
|
+
- `listButtonText` (`string`) โ List button label _(default `'Pilih Menu'`)_
|
|
732
|
+
- `listSectionTitle` (`string`) โ List section title _(default `'Pilihan'`)_
|
|
733
|
+
- `listMenu` (`array`) โ Menu rows
|
|
734
|
+
- `extraButtons` (`array`) โ Extra buttons
|
|
612
735
|
|
|
613
736
|
</details>
|
|
614
737
|
|
|
@@ -678,20 +801,17 @@ await sock.sendMessage(jid, {
|
|
|
678
801
|
<details>
|
|
679
802
|
<summary><b>๐ Fields Reference</b></summary>
|
|
680
803
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
| `taxOffset` | `number` | โ | `100` | Tax divider |
|
|
693
|
-
| `currency` | `string` | โ | `'IDR'` | Currency code |
|
|
694
|
-
|
|
804
|
+
- `image` (`Buffer / URL / path`) โ Header card image _(required)_
|
|
805
|
+
- `title` (`string`) โ Header title _(default `'Order Status'`)_
|
|
806
|
+
- `text` (`string`) โ Body text _(default `'Silakan cek status pesanan Anda.'`)_
|
|
807
|
+
- `footer` (`string`) โ Footer text _(default `'Powered by PontaCT'`)_
|
|
808
|
+
- `referenceId` (`string`) โ Order reference ID _(default `'PT-001'`)_
|
|
809
|
+
- `status` (`string`) โ Order status _(default `'PROCESSING'`)_
|
|
810
|
+
- `subtotalValue` (`number`) โ Subtotal value (in offset units) _(default `0`)_
|
|
811
|
+
- `subtotalOffset` (`number`) โ Value divider _(default `100`)_
|
|
812
|
+
- `taxValue` (`number`) โ Tax value _(default `0`)_
|
|
813
|
+
- `taxOffset` (`number`) โ Tax divider _(default `100`)_
|
|
814
|
+
- `currency` (`string`) โ Currency code _(default `'IDR'`)_
|
|
695
815
|
> **Status values:** `PROCESSING` ยท `SHIPPED` ยท `DELIVERED` ยท `CANCELLED` ยท `REFUNDED`
|
|
696
816
|
|
|
697
817
|
</details>
|
|
@@ -800,19 +920,17 @@ await sock.sendMessage(jid, {
|
|
|
800
920
|
<details>
|
|
801
921
|
<summary><b>Supported Languages</b></summary>
|
|
802
922
|
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
| PowerShell / CMD | `powershell` ยท `ps1` ยท `cmd` ยท `bat` |
|
|
815
|
-
| SQL / JSON | `sql` ยท `json` |
|
|
923
|
+
- **JavaScript** โ `javascript` ยท `js`
|
|
924
|
+
- **TypeScript** โ `typescript` ยท `ts`
|
|
925
|
+
- **Python** โ `python` ยท `py`
|
|
926
|
+
- **Bash / Shell** โ `bash` ยท `sh` ยท `zsh`
|
|
927
|
+
- **Go** โ `go` ยท `golang`
|
|
928
|
+
- **Rust** โ `rust` ยท `rs`
|
|
929
|
+
- **C / C++** โ `c` ยท `h` ยท `cpp` ยท `c++`
|
|
930
|
+
- **C#** โ `csharp` ยท `cs`
|
|
931
|
+
- **CSS / HTML** โ `css` ยท `html`
|
|
932
|
+
- **PowerShell / CMD** โ `powershell` ยท `ps1` ยท `cmd` ยท `bat`
|
|
933
|
+
- **SQL / JSON** โ `sql` ยท `json`
|
|
816
934
|
|
|
817
935
|
</details>
|
|
818
936
|
|
|
@@ -1231,18 +1349,16 @@ await sock.sendMessage(jid, {
|
|
|
1231
1349
|
<details>
|
|
1232
1350
|
<summary><b>๐ Fields Reference</b></summary>
|
|
1233
1351
|
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
| `reel_source` | `string` | `'IG'` | Source platform |
|
|
1245
|
-
| `is_verified` | `boolean` | `false` | Verified badge |
|
|
1352
|
+
- `title` (`string`) โ Username / creator name
|
|
1353
|
+
- `profileIconUrl` (`string`) โ Avatar URL
|
|
1354
|
+
- `thumbnailUrl` (`string`) โ Thumbnail cover URL
|
|
1355
|
+
- `videoUrl` (`string`) โ Video source URL
|
|
1356
|
+
- `reels_title` (`string`) โ Reel title _(default `''`)_
|
|
1357
|
+
- `likes_count` (`number`) โ Like count _(default `0`)_
|
|
1358
|
+
- `shares_count` (`number`) โ Share count _(default `0`)_
|
|
1359
|
+
- `view_count` (`number`) โ View count _(default `0`)_
|
|
1360
|
+
- `reel_source` (`string`) โ Source platform _(default `'IG'`)_
|
|
1361
|
+
- `is_verified` (`boolean`) โ Verified badge _(default `false`)_
|
|
1246
1362
|
|
|
1247
1363
|
</details>
|
|
1248
1364
|
|
|
@@ -1530,6 +1646,28 @@ await sock.sendMessage(jid, {
|
|
|
1530
1646
|
```
|
|
1531
1647
|
</details>
|
|
1532
1648
|
|
|
1649
|
+
<details>
|
|
1650
|
+
<summary><b><code>bypassDownload</code> โ re-send otomatis rich message</b></summary>
|
|
1651
|
+
|
|
1652
|
+
> Default `true`. Setiap rich message dikirim ulang sekali sebagai self-edit tepat setelah relay pertama. Matikan per pesan dengan `false`.
|
|
1653
|
+
|
|
1654
|
+
```js
|
|
1655
|
+
await sock.sendMessage(jid, { richText: 'tanpa bypass' }, { bypassDownload: false })
|
|
1656
|
+
```
|
|
1657
|
+
</details>
|
|
1658
|
+
|
|
1659
|
+
<details>
|
|
1660
|
+
<summary><b><code>unifiedGzip</code> โ kirim isi rich message ter-gzip</b></summary>
|
|
1661
|
+
|
|
1662
|
+
> Default `false`. Isi rich message dikompres gzip dan dikirim lewat `gzipData`. Pesan jadi lebih kecil, tapi klien yang belum mengenal `gzipData` bisa menampilkan rich message kosong. Aktifkan hanya kalau sudah dites di perangkat tujuan.
|
|
1663
|
+
|
|
1664
|
+
```js
|
|
1665
|
+
await sock.sendMessage(jid, { richText: 'Isi ter-gzip', unifiedGzip: true })
|
|
1666
|
+
```
|
|
1667
|
+
|
|
1668
|
+
Helper: `packUnifiedResponse(unified, gzip)`. Pembacaan `data` maupun `gzipData` otomatis.
|
|
1669
|
+
</details>
|
|
1670
|
+
|
|
1533
1671
|
---
|
|
1534
1672
|
|
|
1535
1673
|
## ๐ฃ Newsletter
|
|
@@ -1687,13 +1825,11 @@ await sock.sendMessage(jid, {
|
|
|
1687
1825
|
<details>
|
|
1688
1826
|
<summary><b>๐ Fields Reference</b></summary>
|
|
1689
1827
|
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
| `textArgb` | `number` | โ | โ | Text ARGB color (text only) |
|
|
1696
|
-
| `font` | `number` | โ | โ | Font style 0โ9 (text only) |
|
|
1828
|
+
- `message` (`string / object`) โ Status content (string or WAMessage) _(required)_
|
|
1829
|
+
- `audienceType` (`number`) โ Target audience (0 = all) _(default `0`)_
|
|
1830
|
+
- `backgroundArgb` (`number`) โ Background ARGB color (text only)
|
|
1831
|
+
- `textArgb` (`number`) โ Text ARGB color (text only)
|
|
1832
|
+
- `font` (`number`) โ Font style 0โ9 (text only)
|
|
1697
1833
|
|
|
1698
1834
|
</details>
|
|
1699
1835
|
|