@nuiisweety/baileys 0.1.11 โ†’ 0.1.13

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
@@ -7,7 +7,7 @@
7
7
  *Fork dari [`@whiskeysockets/baileys`](https://github.com/WhiskeySockets/Baileys) v7.0.0-rc11*
8
8
  *dikembangkan dengan sepenuh hati oleh **NuiiS4TORU***
9
9
 
10
- [![npm version](https://img.shields.io/badge/npm-0.1.11-pink?style=flat-square&logo=npm)](https://www.npmjs.com/package/@nuiisweety/baileys)
10
+ [![npm version](https://img.shields.io/badge/npm-0.1.13-pink?style=flat-square&logo=npm)](https://www.npmjs.com/package/@nuiisweety/baileys)
11
11
  [![license](https://img.shields.io/badge/license-MIT-lavender?style=flat-square)](LICENSE)
12
12
  [![based on](https://img.shields.io/badge/based%20on-@whiskeysockets%2Fbaileys-orchid?style=flat-square)](https://github.com/WhiskeySockets/Baileys)
13
13
 
@@ -72,11 +72,16 @@
72
72
  [Secure Meta Label](#secure-meta-service-label)
73
73
 
74
74
  ๐ŸŽ›๏ธ **Interactive** โ€”
75
+ [Buttons Location Header](#buttons-dengan-location-header-buttonsmessage-langsung) ยท
75
76
  [Buttons](#buttons) ยท
76
77
  [List Message](#list-message) ยท
77
78
  [Template Buttons](#template-buttons) ยท
78
79
  [Native Flow](#native-flow) ยท
79
- [Carousel](#carousel)
80
+ [Carousel](#carousel) ยท
81
+ [Shop Message](#shop-message) ยท
82
+ [Collection Message](#collection-message) ยท
83
+ [Order Status Message](#order-status-message) ยท
84
+ [Product List Message](#product-list-message)
80
85
 
81
86
  ๐Ÿค– **Rich Message (AI)** โ€”
82
87
  [Text](#addtext) ยท
@@ -927,11 +932,85 @@ await sock.sendMessage(jid, {
927
932
 
928
933
  ---
929
934
 
935
+ <details>
936
+ <summary>๐Ÿ“ Buttons dengan Location Header (buttonsMessage langsung)</summary>
937
+
938
+ Kirim tombol menggunakan `buttonsMessage` secara langsung โ€” berguna untuk header tipe **Location** (`headerType: 6`) yang tidak bisa dibuat lewat shorthand `buttons`.
939
+
940
+ ```js
941
+ // Tombol dengan header lokasi (headerType 6)
942
+ await sock.sendMessage(jid, {
943
+ buttonsMessage: {
944
+ locationMessage: {
945
+ degreesLatitude: 0,
946
+ degreesLongitude: 0,
947
+ name: 'NuiiSweety',
948
+ address: 'NuiiSweety Bot',
949
+ jpegThumbnail: './src/img/menu.jpg' // path file, URL, atau Buffer
950
+ },
951
+ contentText: 'Pilih menu di bawah ini',
952
+ footerText: 'Powered by @nuiisweety/baileys',
953
+ buttons: [
954
+ { buttonId: 'allmenu', buttonText: { displayText: 'All Menu' }, type: 1 }
955
+ ],
956
+ headerType: 6
957
+ }
958
+ })
959
+
960
+ // Dengan quoted (reply ke pesan tertentu)
961
+ await sock.sendMessage(jid, {
962
+ buttonsMessage: {
963
+ locationMessage: {
964
+ degreesLatitude: -6.2,
965
+ degreesLongitude: 106.8,
966
+ name: 'Menu Bot',
967
+ address: 'NuiiSweety',
968
+ jpegThumbnail: './src/img/menu.jpg'
969
+ },
970
+ contentText: 'Halo! Ini menu utama bot',
971
+ footerText: 'NuiiSweety Bot',
972
+ buttons: [
973
+ { buttonId: 'menu1', buttonText: { displayText: '๐Ÿฑ Menu Utama' }, type: 1 },
974
+ { buttonId: 'help', buttonText: { displayText: 'โ“ Bantuan' }, type: 1 }
975
+ ],
976
+ headerType: 6
977
+ }
978
+ }, { quoted: m })
979
+
980
+ // Header kosong (teks saja, tanpa media/lokasi) โ€” headerType 1
981
+ await sock.sendMessage(jid, {
982
+ buttonsMessage: {
983
+ contentText: 'Pilih opsi',
984
+ footerText: 'Bot Footer',
985
+ buttons: [
986
+ { buttonId: 'yes', buttonText: { displayText: 'Ya' }, type: 1 },
987
+ { buttonId: 'no', buttonText: { displayText: 'Tidak' }, type: 1 }
988
+ ],
989
+ headerType: 1
990
+ }
991
+ })
992
+ ```
993
+
994
+ > **Catatan `headerType`:**
995
+ > | Nilai | Tipe Header |
996
+ > |-------|-------------|
997
+ > | `1` | Teks (`contentText`) |
998
+ > | `2` | Gambar (`imageMessage`) |
999
+ > | `3` | Video (`videoMessage`) |
1000
+ > | `4` | Dokumen (`documentMessage`) |
1001
+ > | `6` | Lokasi (`locationMessage`) |
1002
+ >
1003
+ > `jpegThumbnail` pada `locationMessage` bisa berupa **path file lokal**, **URL**, atau **Buffer** โ€” otomatis diproses oleh Baileys.
1004
+
1005
+ </details>
1006
+
1007
+ ---
1008
+
930
1009
  <details>
931
1010
  <summary>๐ŸŽ›๏ธ Buttons</summary>
932
1011
 
933
1012
  ```js
934
- // Teks dengan tombol
1013
+ // Teks dengan tombol (quick reply)
935
1014
  await sock.sendMessage(jid, {
936
1015
  text: 'Pilih salah satu',
937
1016
  footer: 'Footer pesan',
@@ -953,7 +1032,28 @@ await sock.sendMessage(jid, {
953
1032
  ]
954
1033
  })
955
1034
 
956
- // Native flow button
1035
+ // Native flow button dalam buttons โ€” pakai name + paramsJson
1036
+ await sock.sendMessage(jid, {
1037
+ text: 'Pilih menu',
1038
+ buttons: [
1039
+ {
1040
+ name: 'single_select',
1041
+ text: 'Buka Menu',
1042
+ paramsJson: JSON.stringify({
1043
+ title: 'Buka Menu',
1044
+ sections: [{
1045
+ title: 'Kategori A',
1046
+ rows: [
1047
+ { id: 'row1', title: 'Item 1', description: 'Deskripsi' },
1048
+ { id: 'row2', title: 'Item 2' }
1049
+ ]
1050
+ }]
1051
+ })
1052
+ }
1053
+ ]
1054
+ })
1055
+
1056
+ // Shorthand: sections langsung di button (otomatis jadi single_select)
957
1057
  await sock.sendMessage(jid, {
958
1058
  text: 'Pilih menu',
959
1059
  buttons: [{
@@ -969,6 +1069,8 @@ await sock.sendMessage(jid, {
969
1069
  })
970
1070
  ```
971
1071
 
1072
+ > **Field tombol:** gunakan `text` atau `buttonText` untuk label. Untuk quick reply gunakan `id`/`buttonId`. Untuk native flow gunakan `name` + `paramsJson`.
1073
+
972
1074
  </details>
973
1075
 
974
1076
  ---
@@ -978,10 +1080,10 @@ await sock.sendMessage(jid, {
978
1080
 
979
1081
  ```js
980
1082
  await sock.sendMessage(jid, {
981
- text: 'Silakan pilih',
982
- title: 'Judul List',
983
- buttonText: 'Buka Daftar',
984
- footer: 'Footer pesan',
1083
+ text: 'Silakan pilih', // โ†’ description (isi pesan)
1084
+ title: 'Judul List', // โ†’ title (judul di atas list)
1085
+ buttonText: 'Buka Daftar', // โ†’ teks tombol pembuka
1086
+ footer: 'Footer pesan', // โ†’ footerText
985
1087
  sections: [
986
1088
  {
987
1089
  title: 'Bagian 1',
@@ -1000,6 +1102,8 @@ await sock.sendMessage(jid, {
1000
1102
  })
1001
1103
  ```
1002
1104
 
1105
+ > **Trigger key:** `sections` (bukan `listMessage`). `listType` otomatis di-set ke `SINGLE_SELECT`. Field `text` di-map ke `description` (isi pesan), bukan judul โ€” gunakan `title` untuk judul list.
1106
+
1003
1107
  </details>
1004
1108
 
1005
1109
  ---
@@ -1010,9 +1114,9 @@ await sock.sendMessage(jid, {
1010
1114
  ```js
1011
1115
  // Teks
1012
1116
  await sock.sendMessage(jid, {
1013
- text: 'Pesan template',
1014
- footer: 'Footer',
1015
- id: 'template-unik',
1117
+ text: 'Pesan template', // โ†’ hydratedContentText
1118
+ footer: 'Footer', // โ†’ hydratedFooterText
1119
+ id: 'template-unik', // โ†’ templateId (opsional, auto-generate jika tidak diisi)
1016
1120
  templateButtons: [
1017
1121
  { id: 'btn1', text: 'Quick Reply' },
1018
1122
  { url: 'https://example.com', text: 'Kunjungi Website' },
@@ -1023,8 +1127,8 @@ await sock.sendMessage(jid, {
1023
1127
  // Gambar sebagai header
1024
1128
  await sock.sendMessage(jid, {
1025
1129
  image: { url: 'https://example.com/img.jpg' },
1026
- caption: 'Isi pesan',
1027
- title: 'Judul',
1130
+ caption: 'Isi pesan', // โ†’ hydratedContentText
1131
+ title: 'Judul', // โ†’ hydratedTitleText (hanya aktif jika ada caption)
1028
1132
  footer: 'Footer',
1029
1133
  templateButtons: [
1030
1134
  { id: 'btn1', text: 'Klik Sini' },
@@ -1033,6 +1137,8 @@ await sock.sendMessage(jid, {
1033
1137
  })
1034
1138
  ```
1035
1139
 
1140
+ > **Tipe tombol:** `{ id, text }` โ†’ quick reply ยท `{ url, text }` โ†’ URL button ยท `{ call, text }` โ†’ call button. `text` atau `buttonText` keduanya diterima. Jika `id` tidak diisi, otomatis `template-<timestamp>`.
1141
+
1036
1142
  </details>
1037
1143
 
1038
1144
  ---
@@ -1041,34 +1147,108 @@ await sock.sendMessage(jid, {
1041
1147
  <summary>๐ŸŒŠ Native Flow</summary>
1042
1148
 
1043
1149
  ```js
1044
- // Teks dengan native flow buttons
1150
+ // Quick reply
1045
1151
  await sock.sendMessage(jid, {
1046
1152
  text: 'Pilih aksi',
1047
1153
  footer: 'Footer pesan',
1048
1154
  nativeFlow: [
1049
- { name: 'quick_reply', paramsJson: '{"id":"1"}', text: 'Opsi 1' },
1050
- { name: 'quick_reply', paramsJson: '{"id":"2"}', text: 'Opsi 2' }
1155
+ { id: '1', text: 'Opsi 1' }, // id โ†’ quick_reply
1156
+ { id: '2', text: 'Opsi 2' }
1051
1157
  ]
1052
1158
  })
1053
1159
 
1054
- // Gambar sebagai header
1160
+ // URL button
1161
+ await sock.sendMessage(jid, {
1162
+ text: 'Kunjungi kami',
1163
+ nativeFlow: [
1164
+ { url: 'https://example.com', text: 'Buka Website' }
1165
+ ]
1166
+ })
1167
+
1168
+ // Copy code button
1169
+ await sock.sendMessage(jid, {
1170
+ text: 'Kode promo kamu',
1171
+ nativeFlow: [
1172
+ { copy: 'PROMO2025', text: 'Salin Kode' }
1173
+ ]
1174
+ })
1175
+
1176
+ // Call button
1177
+ await sock.sendMessage(jid, {
1178
+ text: 'Hubungi kami',
1179
+ nativeFlow: [
1180
+ { call: '+62812345678', text: 'Telepon Sekarang' }
1181
+ ]
1182
+ })
1183
+
1184
+ // Single select (list dalam button)
1185
+ await sock.sendMessage(jid, {
1186
+ text: 'Pilih menu',
1187
+ nativeFlow: [
1188
+ {
1189
+ sections: [{
1190
+ title: 'Kategori A',
1191
+ rows: [
1192
+ { id: 'row1', title: 'Item 1', description: 'Deskripsi' },
1193
+ { id: 'row2', title: 'Item 2' }
1194
+ ]
1195
+ }],
1196
+ text: 'Buka Daftar'
1197
+ }
1198
+ ]
1199
+ })
1200
+
1201
+ // Dengan icon pada tombol
1202
+ await sock.sendMessage(jid, {
1203
+ text: 'Pilih aksi',
1204
+ nativeFlow: [
1205
+ { id: '1', text: 'Konfirmasi', icon: 'CHECK' },
1206
+ { url: 'https://example.com', text: 'Buka', icon: 'LINK' }
1207
+ ]
1208
+ })
1209
+
1210
+ // Gambar sebagai header โ€” WAJIB pakai image/video/document/location/product
1211
+ // jika tidak ada media valid โ†’ throw Error: Invalid media type
1055
1212
  await sock.sendMessage(jid, {
1056
1213
  image: { url: 'https://example.com/img.jpg' },
1057
- caption: 'Isi pesan',
1058
- title: 'Judul',
1059
- subtitle: 'Subjudul',
1214
+ caption: 'Isi pesan', // โ†’ body.text
1215
+ title: 'Judul', // โ†’ header.title
1216
+ subtitle: 'Subjudul', // โ†’ header.subtitle
1060
1217
  footer: 'Footer',
1061
1218
  nativeFlow: [
1062
- { name: 'quick_reply', paramsJson: '{"id":"1"}', text: 'Tombol 1' }
1219
+ { id: '1', text: 'Tombol 1' }
1063
1220
  ]
1064
1221
  })
1065
1222
 
1066
- // Dengan audio footer
1223
+ // Dengan audio footer (menggantikan footer teks)
1067
1224
  await sock.sendMessage(jid, {
1068
1225
  text: 'Pesan dengan audio footer',
1069
1226
  audioFooter: fs.readFileSync('audio.ogg'),
1070
1227
  nativeFlow: [
1071
- { name: 'quick_reply', paramsJson: '{"id":"1"}', text: 'OK' }
1228
+ { id: '1', text: 'OK' }
1229
+ ]
1230
+ })
1231
+
1232
+ // offerText โ€” tampil sebagai limited time offer banner
1233
+ await sock.sendMessage(jid, {
1234
+ text: 'Penawaran terbatas!',
1235
+ offerText: 'Diskon 50%',
1236
+ offerUrl: 'https://example.com/promo',
1237
+ offerCode: 'DISKON50',
1238
+ offerExpiration: 1800000000,
1239
+ nativeFlow: [
1240
+ { id: 'claim', text: 'Klaim Sekarang' }
1241
+ ]
1242
+ })
1243
+
1244
+ // optionText โ€” tombol-tombol masuk ke bottom sheet
1245
+ await sock.sendMessage(jid, {
1246
+ text: 'Pilih opsi',
1247
+ optionText: 'Lihat Semua Opsi',
1248
+ optionTitle: 'Daftar Pilihan',
1249
+ nativeFlow: [
1250
+ { id: '1', text: 'Opsi A' },
1251
+ { id: '2', text: 'Opsi B' }
1072
1252
  ]
1073
1253
  })
1074
1254
 
@@ -1076,13 +1256,126 @@ await sock.sendMessage(jid, {
1076
1256
  await sock.sendMessage(jid, {
1077
1257
  text: 'Template interaktif',
1078
1258
  nativeFlow: [
1079
- { name: 'quick_reply', paramsJson: '{"id":"1"}', text: 'Tombol' }
1259
+ { id: '1', text: 'Tombol' }
1080
1260
  ],
1081
1261
  interactiveAsTemplate: true,
1082
1262
  id: 'template-id-unik'
1083
1263
  })
1084
1264
  ```
1085
1265
 
1266
+ > **Tipe tombol ditentukan otomatis** dari field yang ada:
1267
+ >
1268
+ > | Field pada button | Native Flow yang dihasilkan |
1269
+ > |---|---|
1270
+ > | `id` | `quick_reply` |
1271
+ > | `url` | `cta_url` |
1272
+ > | `copy` | `cta_copy` |
1273
+ > | `call` | `cta_call` |
1274
+ > | `sections` | `single_select` |
1275
+ > | `catalog` | `cta_catalog` |
1276
+ > | `reminder: true` | `cta_reminder` |
1277
+ > | `cancelReminder: true` | `cta_cancel_reminder` |
1278
+ > | `address: true` | `address_message` |
1279
+ > | `location: true` | `send_location` |
1280
+ > | `webview` | `open_webview` |
1281
+ > | `productId` | `mpm` |
1282
+ > | `transactionId` | `wa_payment_transaction_details` |
1283
+ > | `catalogProduct` | `automated_greeting_message_view_catalog` |
1284
+ > | `flow` | `galaxy_message` (WA Flow) |
1285
+ >
1286
+ > Bisa juga pakai `name` + `paramsJson` langsung untuk kontrol penuh. `text` atau `buttonText` keduanya diterima. Field `icon` opsional (string uppercase, e.g. `'CHECK'`, `'LINK'`).
1287
+
1288
+ ```js
1289
+ // Catalog button โ€” buka katalog bisnis
1290
+ await sock.sendMessage(jid, {
1291
+ text: 'Lihat produk kami',
1292
+ nativeFlow: [
1293
+ { catalog: '628xxx', text: 'Buka Katalog' }
1294
+ ]
1295
+ })
1296
+
1297
+ // Reminder button
1298
+ await sock.sendMessage(jid, {
1299
+ text: 'Ingatkan saya',
1300
+ nativeFlow: [
1301
+ { reminder: true, text: 'Set Pengingat' },
1302
+ { cancelReminder: true, text: 'Batalkan Pengingat' }
1303
+ ]
1304
+ })
1305
+
1306
+ // Address & Location button
1307
+ await sock.sendMessage(jid, {
1308
+ text: 'Butuh info lokasi',
1309
+ nativeFlow: [
1310
+ { address: true, text: 'Bagikan Alamat' },
1311
+ { location: true, text: 'Kirim Lokasi' }
1312
+ ]
1313
+ })
1314
+
1315
+ // Open Webview button
1316
+ await sock.sendMessage(jid, {
1317
+ text: 'Buka halaman web',
1318
+ nativeFlow: [
1319
+ { webview: 'https://example.com', text: 'Buka', inAppWebview: true }
1320
+ ]
1321
+ })
1322
+
1323
+ // MPM โ€” Multi-product message button
1324
+ await sock.sendMessage(jid, {
1325
+ text: 'Produk pilihan',
1326
+ nativeFlow: [
1327
+ { productId: '8816262248471474', text: 'Lihat Produk' }
1328
+ ]
1329
+ })
1330
+
1331
+ // Payment transaction details button
1332
+ await sock.sendMessage(jid, {
1333
+ text: 'Detail pembayaran',
1334
+ nativeFlow: [
1335
+ { transactionId: '12345848', text: 'Lihat Detail' }
1336
+ ]
1337
+ })
1338
+
1339
+ // Automated greeting catalog button
1340
+ await sock.sendMessage(jid, {
1341
+ text: 'Halo! Cek katalog kami',
1342
+ nativeFlow: [
1343
+ {
1344
+ catalogProduct: { bizPhone: '628xxx', productId: '12345' },
1345
+ text: 'Lihat Katalog'
1346
+ }
1347
+ ]
1348
+ })
1349
+
1350
+ // WA Flow (galaxy_message)
1351
+ await sock.sendMessage(jid, {
1352
+ text: 'Isi formulir pendaftaran',
1353
+ nativeFlow: [
1354
+ {
1355
+ flow: {
1356
+ mode: 'published',
1357
+ flowId: '1307913409923914',
1358
+ flowToken: '1:1307913409923914:293680f87029f5a13d1ec5e35e718af3',
1359
+ flowCta: 'Daftar Sekarang',
1360
+ flowAction: 'navigate',
1361
+ flowActionPayload: {
1362
+ screen: 'QUESTION_ONE',
1363
+ params: { user_id: '123456789' }
1364
+ },
1365
+ flowMetadata: {
1366
+ flow_json_version: '201',
1367
+ data_api_protocol: 'v2',
1368
+ flow_name: 'Lead Qualification',
1369
+ data_api_version: 'v2',
1370
+ categories: ['Lead Generation']
1371
+ }
1372
+ },
1373
+ text: 'Buka Flow'
1374
+ }
1375
+ ]
1376
+ })
1377
+ ```
1378
+
1086
1379
  </details>
1087
1380
 
1088
1381
  ---
@@ -1120,6 +1413,172 @@ await sock.sendMessage(jid, {
1120
1413
 
1121
1414
  ---
1122
1415
 
1416
+ <details>
1417
+ <summary>๐Ÿช Shop Message</summary>
1418
+
1419
+ Menampilkan storefront toko bisnis WhatsApp. Bisa dengan header teks, gambar, video, dokumen, lokasi, atau produk.
1420
+
1421
+ ```js
1422
+ // Teks biasa
1423
+ await sock.sendMessage(jid, {
1424
+ text: 'Kunjungi toko kami!',
1425
+ title: 'Toko Kami',
1426
+ subtitle: 'Produk terbaik',
1427
+ footer: 'Belanja sekarang',
1428
+ shop: {
1429
+ surface: 1, // 1 | 2 | 3 | 4
1430
+ id: 'https://example.com'
1431
+ }
1432
+ })
1433
+
1434
+ // Dengan gambar
1435
+ await sock.sendMessage(jid, {
1436
+ image: { url: 'https://example.com/banner.jpg' },
1437
+ caption: 'Promo spesial hari ini!',
1438
+ title: 'Toko Kami',
1439
+ subtitle: 'Diskon 50%',
1440
+ footer: 'Tap untuk belanja',
1441
+ hasMediaAttachment: true,
1442
+ shop: {
1443
+ surface: 1,
1444
+ id: 'https://example.com'
1445
+ }
1446
+ })
1447
+
1448
+ // Dengan video
1449
+ await sock.sendMessage(jid, {
1450
+ video: { url: 'https://example.com/promo.mp4' },
1451
+ caption: 'Tonton promo kami!',
1452
+ title: 'Promo Bulan Ini',
1453
+ footer: 'Belanja sekarang',
1454
+ hasMediaAttachment: true,
1455
+ shop: { surface: 2, id: 'https://example.com' }
1456
+ })
1457
+ ```
1458
+
1459
+ </details>
1460
+
1461
+ ---
1462
+
1463
+ <details>
1464
+ <summary>๐Ÿ“ฆ Collection Message</summary>
1465
+
1466
+ Menampilkan koleksi produk dari bisnis WhatsApp.
1467
+
1468
+ ```js
1469
+ // Teks biasa
1470
+ await sock.sendMessage(jid, {
1471
+ text: 'Koleksi terbaru kami',
1472
+ title: 'Koleksi Musim Ini',
1473
+ subtitle: 'Pilihan terbaik',
1474
+ footer: 'Lihat semua',
1475
+ collection: {
1476
+ bizJid: '628xxx@s.whatsapp.net',
1477
+ id: 'collection-id-123',
1478
+ version: 1
1479
+ }
1480
+ })
1481
+
1482
+ // Dengan gambar
1483
+ await sock.sendMessage(jid, {
1484
+ image: { url: 'https://example.com/collection.jpg' },
1485
+ caption: 'Temukan koleksi terbaru!',
1486
+ title: 'Koleksi Baru',
1487
+ subtitle: 'Limited edition',
1488
+ footer: 'Stok terbatas!',
1489
+ hasMediaAttachment: true,
1490
+ collection: {
1491
+ bizJid: '628xxx@s.whatsapp.net',
1492
+ id: 'collection-id-456',
1493
+ version: 1
1494
+ }
1495
+ })
1496
+ ```
1497
+
1498
+ </details>
1499
+
1500
+ ---
1501
+
1502
+ <details>
1503
+ <summary>๐Ÿ“ฆ Order Status Message</summary>
1504
+
1505
+ Mengirim kartu status pesanan dengan tampilan native WhatsApp (menggunakan `order_status` native flow, dibungkus view once).
1506
+
1507
+ ```js
1508
+ await sock.sendMessage(jid, {
1509
+ orderStatus: {
1510
+ image: 'path/to/image.jpg', // string path, URL, atau Buffer โ€” wajib
1511
+ title: 'Status Pesananmu', // judul header
1512
+ text: 'Pesananmu sedang diproses.',
1513
+ footer: 'Terima kasih sudah belanja!',
1514
+ referenceId: 'ORDER-001', // ID referensi pesanan
1515
+ status: 'PROCESSING', // PROCESSING | COMPLETED | CANCELLED | dst
1516
+ subtotalValue: 50000, // subtotal dalam satuan terkecil
1517
+ subtotalOffset: 100, // pembagi (100 = dalam rupiah)
1518
+ taxValue: 5000,
1519
+ taxOffset: 100,
1520
+ currency: 'IDR'
1521
+ }
1522
+ })
1523
+
1524
+ // Status pesanan selesai
1525
+ await sock.sendMessage(jid, {
1526
+ orderStatus: {
1527
+ image: { url: 'https://example.com/order.jpg' },
1528
+ title: 'Pesanan Selesai! ๐ŸŽ‰',
1529
+ text: 'Pesananmu telah dikirim.',
1530
+ referenceId: 'ORDER-789',
1531
+ status: 'COMPLETED',
1532
+ subtotalValue: 150000,
1533
+ subtotalOffset: 100,
1534
+ taxValue: 0,
1535
+ taxOffset: 100,
1536
+ currency: 'IDR'
1537
+ }
1538
+ }, { quoted: m })
1539
+ ```
1540
+
1541
+ > โš ๏ธ `image` wajib diisi โ€” `orderStatus` selalu dibungkus dalam viewOnceMessage.
1542
+
1543
+ </details>
1544
+
1545
+ ---
1546
+
1547
+ <details>
1548
+ <summary>๐Ÿ›’ Product List Message</summary>
1549
+
1550
+ Menampilkan list produk bisnis (hanya berfungsi di private chat).
1551
+
1552
+ ```js
1553
+ await sock.sendMessage(jid, {
1554
+ text: 'Pilih produk yang kamu inginkan',
1555
+ title: 'Produk Pilihan',
1556
+ buttonText: 'Lihat Daftar Produk',
1557
+ footer: 'Stok terbatas!',
1558
+ businessOwnerJid: '628xxx@s.whatsapp.net',
1559
+ thumbnail: { url: 'https://example.com/thumbnail.jpg' }, // opsional
1560
+ productList: [
1561
+ {
1562
+ title: 'Kategori Makanan',
1563
+ products: [
1564
+ { productId: '111222333' },
1565
+ { productId: '444555666' }
1566
+ ]
1567
+ },
1568
+ {
1569
+ title: 'Kategori Minuman',
1570
+ products: [
1571
+ { productId: '777888999' }
1572
+ ]
1573
+ }
1574
+ ]
1575
+ })
1576
+ ```
1577
+
1578
+ </details>
1579
+
1580
+ ---
1581
+
1123
1582
  <details>
1124
1583
  <summary>๐Ÿท๏ธ Status Mention</summary>
1125
1584
 
@@ -1148,16 +1607,46 @@ await sock.sendMessage(['628xxx@s.whatsapp.net'], {
1148
1607
 
1149
1608
  > Rich message menggunakan format `AIRichResponseMessage` yang tampil seperti respons AI di WhatsApp. Semua tipe di bawah bisa dipakai secara flat (field langsung) atau dikombinasikan via `richResponse: [...]`.
1150
1609
 
1610
+ > โš ๏ธ **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.
1611
+
1151
1612
  ### โœ๏ธ addText
1152
1613
 
1153
1614
  Kirim teks markdown sebagai AI Rich Response. Mendukung hyperlink, citation, dan LaTeX inline.
1154
1615
 
1616
+ Karena `contentText` bukan trigger key, gunakan `richResponse: [{ text }]` untuk pesan teks murni:
1617
+
1618
+ ```js
1619
+ // โœ… Cara benar โ€” pakai richResponse array
1620
+ await sock.sendMessage(jid, {
1621
+ richResponse: [
1622
+ { text: 'Ini teks dari AI dengan *markdown* dan **bold**.' }
1623
+ ],
1624
+ headerText: 'Judul',
1625
+ footerText: 'Footer',
1626
+ disclaimerText: 'Generated by AI'
1627
+ })
1628
+ ```
1629
+
1630
+ ```js
1631
+ // โœ… Alternatif โ€” contentText sebagai pelengkap dari trigger key lain
1632
+ await sock.sendMessage(jid, {
1633
+ code: 'console.log("Hello")',
1634
+ language: 'javascript',
1635
+ contentText: 'Penjelasan tambahan di sini.',
1636
+ headerText: 'Judul',
1637
+ footerText: 'Footer',
1638
+ disclaimerText: 'Generated by AI'
1639
+ })
1640
+ ```
1641
+
1155
1642
  ```js
1643
+ // โŒ SALAH โ€” contentText saja tidak akan trigger rich message
1156
1644
  await sock.sendMessage(jid, {
1157
- contentText: 'Ini teks dari AI dengan *markdown* dan **bold**.',
1645
+ contentText: 'halooo',
1158
1646
  headerText: 'Judul',
1159
1647
  footerText: 'Footer',
1160
1648
  disclaimerText: 'Generated by AI'
1649
+ // โ†’ Error: Invalid media type
1161
1650
  })
1162
1651
  ```
1163
1652