@ryuu-reinzz/baileys 5.2.2 → 5.4.0
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 +18 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -473,6 +473,24 @@ The store also provides some simple functions such as `loadMessages` that utiliz
|
|
|
473
473
|
sock.sendMessage(jid, content, options)
|
|
474
474
|
```
|
|
475
475
|
|
|
476
|
+
### Interactive Buttons — `sock.sendButton(jid, content, options)`
|
|
477
|
+
|
|
478
|
+
> Injected into the socket by `@ryuu-reinzz/luna-lib` (`addProperty`). Sends native flow buttons with an optional media header (`image`/`video`/`document`/`location`/`product`).
|
|
479
|
+
|
|
480
|
+
> [!WARNING]
|
|
481
|
+
> When a media header (`image`, `video`, `document`, `location`, `product`) is provided, the text shown under the media **must** be passed via the **`caption`** parameter — **not** `text`. Using `text` together with media makes the button message fail/error on WhatsApp's side.
|
|
482
|
+
|
|
483
|
+
```ts
|
|
484
|
+
await sock.sendButton(jid, {
|
|
485
|
+
caption: 'Choose an option below:', // image is present → use caption, not text
|
|
486
|
+
footer: '© Example',
|
|
487
|
+
buttons: [
|
|
488
|
+
{ name: 'quick_reply', buttonParamsJson: JSON.stringify({ display_text: 'Menu', id: '.menu' }) }
|
|
489
|
+
],
|
|
490
|
+
image: 'https://example.com/banner.jpg'
|
|
491
|
+
}, { quoted: m })
|
|
492
|
+
```
|
|
493
|
+
|
|
476
494
|
### Non-Media Messages
|
|
477
495
|
|
|
478
496
|
#### Text Message
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"require": "./lib/index.cjs"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
"version": "5.
|
|
11
|
+
"version": "5.4.0",
|
|
12
12
|
"description": "A WebSockets library for interacting with WhatsApp Web",
|
|
13
13
|
"keywords": [
|
|
14
14
|
"whatsapp",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@cacheable/node-cache": "^1.4.0",
|
|
31
|
-
"@ryuu-reinzz/luna-lib": "4.
|
|
31
|
+
"@ryuu-reinzz/luna-lib": "4.3.0",
|
|
32
32
|
"@hapi/boom": "^9.1.3",
|
|
33
33
|
"async-mutex": "^0.5.0",
|
|
34
34
|
"better-sqlite3": "^12.5.0",
|
|
@@ -124,4 +124,4 @@
|
|
|
124
124
|
"engines": {
|
|
125
125
|
"node": ">=20.0.0"
|
|
126
126
|
}
|
|
127
|
-
}
|
|
127
|
+
}
|