@blurose/baileys 1.1.18 → 1.1.20
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 +27 -2
- package/WAProto/index.d.ts +4267 -1793
- package/WAProto/index.js +30397 -24012
- package/lib/Socket/business.d.ts +9 -0
- package/lib/Socket/business.d.ts.map +1 -1
- package/lib/Socket/communities.d.ts +9 -0
- package/lib/Socket/communities.d.ts.map +1 -1
- package/lib/Socket/index.d.ts +9 -0
- package/lib/Socket/index.d.ts.map +1 -1
- package/lib/Socket/messages-recv.d.ts +9 -0
- package/lib/Socket/messages-recv.d.ts.map +1 -1
- package/lib/Socket/messages-send.d.ts +10 -0
- package/lib/Socket/messages-send.d.ts.map +1 -1
- package/lib/Socket/messages-send.js +87 -0
- package/lib/Socket/messages-send.js.map +1 -1
- package/lib/Utils/a2ui.d.ts +68 -54
- package/lib/Utils/a2ui.d.ts.map +1 -1
- package/lib/Utils/a2ui.js +158 -42
- package/lib/Utils/a2ui.js.map +1 -1
- package/lib/Utils/history.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -217,7 +217,30 @@ const card = ui.card(ui.column([title, desc, checkbox]))
|
|
|
217
217
|
// 2. Set the root layout
|
|
218
218
|
ui.root([card])
|
|
219
219
|
|
|
220
|
-
// 3. Send
|
|
220
|
+
// 3. Send via built-in helper!
|
|
221
|
+
await sock.sendA2UIWidget(jid, ui, {
|
|
222
|
+
bodyText: "Message body",
|
|
223
|
+
footer: "Footer text"
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
// Or even simpler, for List Cards you don't even need to build the UI manually!
|
|
227
|
+
// You can directly link to products from your wa.me/p/ catalog using assetId
|
|
228
|
+
await sock.sendListCard(jid, {
|
|
229
|
+
title: "🔥 Katalog Produk Toko",
|
|
230
|
+
fallbackText: "Katalog gagal dimuat di device Anda.",
|
|
231
|
+
items: [
|
|
232
|
+
{
|
|
233
|
+
title: "Alight Motion Pro 1 Tahun",
|
|
234
|
+
price: "Rp 15.000",
|
|
235
|
+
assetId: "26885083354498068" // ID from wa.me/p/26885083354498068
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
title: "Spotify Premium",
|
|
239
|
+
price: "Rp 20.000",
|
|
240
|
+
assetId: "12345678901234567"
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
})
|
|
221
244
|
await sock.sendMessage(jid, {
|
|
222
245
|
a2ui: ui,
|
|
223
246
|
text: "Fallback body text",
|
|
@@ -731,7 +754,9 @@ await sock.sendMessage(
|
|
|
731
754
|
audio: {
|
|
732
755
|
url: './Media/audio.mp3'
|
|
733
756
|
},
|
|
734
|
-
mimetype: 'audio/mp4'
|
|
757
|
+
mimetype: 'audio/mp4',
|
|
758
|
+
ptt: true, // set to true to send as a Voice Note (VN)
|
|
759
|
+
waveform: new Uint8Array(64).map(() => Math.floor(Math.random() * 100)) // generate a random 64-bar waveform
|
|
735
760
|
}
|
|
736
761
|
)
|
|
737
762
|
```
|