@xbibzlibrary/whatsbibz 2.0.0 → 2.1.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/ANALISIS-ALUR.md +1 -1
- package/CHANGELOG.md +25 -0
- package/KOMPATIBILITAS-WHATSAPP-2026-11.md +1 -1
- package/README.cn.md +188 -15
- package/README.id.md +191 -18
- package/README.md +191 -18
- package/SECURITY.md +6 -6
- package/WAProto/WAProto.proto +4 -0
- package/WAProto/index.d.ts +5 -0
- package/WAProto/index.js +61 -0
- package/lib/BibzWhats/banner.d.ts +5 -3
- package/lib/BibzWhats/banner.js +20 -10
- package/lib/BibzWhats/client.d.ts +5 -5
- package/lib/BibzWhats/client.js +73 -40
- package/lib/BibzWhats/extract.js +2 -1
- package/lib/BibzWhats/version.js +6 -1
- package/lib/Socket/auto-follow-channel.d.ts +1 -1
- package/lib/Socket/auto-follow-channel.js +11 -5
- package/lib/Socket/socket.js +31 -11
- package/lib/Types/Socket.d.ts +6 -4
- package/lib/Utils/index.d.ts +1 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/link-preview.js +6 -1
- package/lib/Utils/messages-media.js +18 -17
- package/lib/Utils/messages.js +2 -1
- package/lib/Utils/sound-sticker.d.ts +50 -0
- package/lib/Utils/sound-sticker.js +311 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +4 -1
- package/lib/Utils/use-multi-file-auth-state.js +32 -34
- package/lib/VoIP/audio-feeder.d.ts +1 -1
- package/lib/VoIP/audio-feeder.js +136 -92
- package/lib/VoIP/index.d.ts +53 -7
- package/lib/VoIP/index.js +278 -164
- package/lib/VoIP/relay-transport.d.ts +10 -0
- package/lib/VoIP/relay-transport.js +174 -126
- package/lib/VoIP/signaling.js +46 -12
- package/lib/VoIP/types.d.ts +6 -2
- package/lib/VoIP/wasm-engine.d.ts +7 -0
- package/lib/VoIP/wasm-engine.js +230 -99
- package/lib/index.d.ts +1 -0
- package/package.json +18 -10
package/README.md
CHANGED
|
@@ -39,9 +39,12 @@
|
|
|
39
39
|
- [Custom mode](#custom-mode)
|
|
40
40
|
- [What WhatsApp accepts](#what-whatsapp-accepts)
|
|
41
41
|
- [Sending and reading messages](#sending-and-reading-messages)
|
|
42
|
+
- [Button, location, image, and slide recipes](#message-recipes-buttons-location-images-and-slides)
|
|
43
|
+
- [Sound sticker from a video reply](#sound-sticker-from-a-video-reply-experimental)
|
|
42
44
|
- [Text formatting and chat markup](#text-formatting-and-chat-markup)
|
|
43
45
|
- [Interactive buttons](#interactive-buttons)
|
|
44
46
|
- [Rich and AI-styled messages](#rich-and-ai-styled-messages)
|
|
47
|
+
- [Experimental voice calls](#experimental-voice-calls)
|
|
45
48
|
- [Low-level API (Baileys-compatible)](#low-level-api-baileys-compatible)
|
|
46
49
|
- [TypeScript](#typescript)
|
|
47
50
|
- [Migrating from Baileys](#migrating-from-baileys)
|
|
@@ -73,21 +76,21 @@ Many Baileys-style APIs remain available, but this fork is not identical to ever
|
|
|
73
76
|
|
|
74
77
|
- The package declares **Node.js ≥ 20.18.1**, but Node 20 is EOL. For production use patched **22.23.5+ (22.x), 24.22.3+ (24.x), or 26.13.1+ (26.x)** and follow Node.js security updates.
|
|
75
78
|
- ESM only (`"type": "module"` or dynamic `import()`)
|
|
76
|
-
- Optional peers: `sharp` (
|
|
79
|
+
- Optional peers: `sharp` or `jimp` (thumbnails), `qrcode-terminal` (QR), `link-preview-js` ≥4.0.4, `@audio/decode` (waveforms; legacy `audio-decode` 2.x remains supported), and `@roamhq/wrtc` (VoIP). The legacy builder video preview also uses optional `fluent-ffmpeg` 2.x, which is no longer maintained. Install peers separately. Link previews still need URL validation and DNS/egress controls; they are not a complete SSRF defense.
|
|
77
80
|
|
|
78
81
|
## Installation
|
|
79
82
|
|
|
80
83
|
```bash
|
|
81
84
|
# From your application directory (use a patched Node version):
|
|
82
|
-
npm install @xbibzlibrary/whatsbibz@2.
|
|
85
|
+
npm install @xbibzlibrary/whatsbibz@2.1.0
|
|
83
86
|
|
|
84
87
|
# Or install a local checkout for development:
|
|
85
88
|
npm install /absolute/path/to/whatsbibz
|
|
86
89
|
```
|
|
87
90
|
|
|
88
|
-
|
|
91
|
+
Sound-sticker helpers require version 2.1.0 (they are not in 2.0.0); the runnable bot example is in the repository, not the npm tarball.
|
|
89
92
|
|
|
90
|
-
> **Breaking behavior in 2.0.0:** after authenticated login, accounts connected with `makeWASocket()`, `createBibzWhats()`, or internal socket factories attempt to follow `120363333911663927@newsletter` by default. This changes the account's subscriptions; inform the account owner. Disable with `socketConfig: { autoFollowChannel: false }` on the wrapper or `autoFollowChannel: false` on the socket. Disabling does not undo an existing subscription.
|
|
93
|
+
> **Breaking behavior in 2.0.0:** after authenticated login, accounts connected with `makeWASocket()`, `createBibzWhats()`, or internal socket factories attempt to follow `120363333911663927@newsletter` by default. From 2.1.0 this automatic target is fixed; other JIDs are rejected. Manual follow APIs only run when explicitly called. This changes the account's subscriptions; inform the account owner. Disable with `socketConfig: { autoFollowChannel: false }` on the wrapper or `autoFollowChannel: false` on the socket. Disabling does not undo an existing subscription.
|
|
91
94
|
|
|
92
95
|
## Quick start
|
|
93
96
|
|
|
@@ -132,7 +135,7 @@ const client = await createBibzWhats({
|
|
|
132
135
|
authDir: 'whatsbibz-session',
|
|
133
136
|
socketConfig: {
|
|
134
137
|
autoFollowChannel: true, // v2 default; use false to disable
|
|
135
|
-
autoFollowChannelJid: '120363333911663927@newsletter', //
|
|
138
|
+
autoFollowChannelJid: '120363333911663927@newsletter', // fixed target; other JIDs are rejected
|
|
136
139
|
},
|
|
137
140
|
});
|
|
138
141
|
client.on('newsletter-follow.update', ({ jid, status, attempt, retryInMs, error }) => {
|
|
@@ -140,9 +143,9 @@ client.on('newsletter-follow.update', ({ jid, status, attempt, retryInMs, error
|
|
|
140
143
|
});
|
|
141
144
|
```
|
|
142
145
|
|
|
143
|
-
Statuses are `checking`, `following`, `already-following`, `followed` (the follow response returned without error), `retrying`, and `failed`. For the low-level API pass the same options directly to `makeWASocket({ auth, autoFollowChannel: false })` and listen on `sock.ev`. The
|
|
146
|
+
Statuses are `checking`, `following`, `already-following`, `followed` (the follow response returned without error), `retrying`, and `failed`. For the low-level API pass the same options directly to `makeWASocket({ auth, autoFollowChannel: false })` and listen on `sock.ev`. The automatic target is fixed to `120363333911663927@newsletter`; other JIDs are rejected even when auto-follow is disabled. Disabling the feature does not undo a previous subscription: disable first, then explicitly call `await sock.newsletterUnfollow(jid)` if needed. Never share session files or pairing codes.
|
|
144
147
|
|
|
145
|
-
For development, run the checkout with `npm ci` and `node example/ping-bot.js PHONE`; applications can install `@xbibzlibrary/whatsbibz@2.
|
|
148
|
+
For development, run the checkout with `npm ci` and `node example/ping-bot.js PHONE`; applications can install `@xbibzlibrary/whatsbibz@2.1.0`. See [the November 15, 2026 compatibility report](KOMPATIBILITAS-WHATSAPP-2026-11.md) for sources and verification limits.
|
|
146
149
|
|
|
147
150
|
## The high-level client: `createBibzWhats()`
|
|
148
151
|
|
|
@@ -161,7 +164,7 @@ For development, run the checkout with `npm ci` and `node example/ping-bot.js PH
|
|
|
161
164
|
| `companionPlatformDisplay` | `string \| null` | `null` | Override the `companion_platform_display` sent at pairing. Only set this if you know the value is on WhatsApp's allow-list. |
|
|
162
165
|
| `logger` | `{ info, warn, error, debug, ok }` | console | Any object with those methods (all optional). |
|
|
163
166
|
| `printQR` | `boolean` | `false` | Print the QR as ASCII when a QR is shown (requires `qrcode-terminal`). |
|
|
164
|
-
| `banner` | `boolean` |
|
|
167
|
+
| `banner` | `boolean` | enabled | Print the versioned banner once per process to stderr when a socket is created; color follows terminal support. `false` or `WHATSBIBZ_BANNER=0` disables it; `true` overrides that variable. |
|
|
165
168
|
| `socketConfig` | `Partial<SocketConfig>` | `{}` | Raw `makeWASocket` options merged last — full escape hatch. |
|
|
166
169
|
| `fetchLatestVersion` | `boolean` | `true` | Fetch from WA Web with a 10-second timeout and do not downgrade the fallback. An explicit `socketConfig.version` takes precedence and skips the lookup. |
|
|
167
170
|
| `forceIPv4` | `boolean` | `true` | Use a per-socket IPv4 Undici dispatcher for media uploads unless `socketConfig.fetchAgent` overrides it. Does not affect WebSockets or standalone downloads. |
|
|
@@ -190,7 +193,7 @@ Defaults are exported as `BIBZWHATS_DEFAULTS`.
|
|
|
190
193
|
| `open` | `(sock)` | Connection opened (every time). |
|
|
191
194
|
| `user` | `(digits)` | The bot's own number became known. |
|
|
192
195
|
| `close` | `({ status, error })` | Connection closed. `status` is the `DisconnectReason` code. |
|
|
193
|
-
| `reconnecting` | `({ delay, attempt, fresh, identity?, pairingPending? })` | A reconnect is scheduled. `fresh` = with new credentials; `identity` = the profile after a rotation; `pairingPending` =
|
|
196
|
+
| `reconnecting` | `({ delay, attempt, fresh, identity?, pairingPending? })` | A reconnect is scheduled. `fresh` = with new credentials; `identity` = the profile after a rotation; `pairingPending` = a heuristic for 401 after a pairing request, not proof of server-side cause. |
|
|
194
197
|
| `identity-changed` | `({ browser, linkedDeviceName, pairingDisplay, pairingDisplayAccepted, profileId, reason })` | Automatic mode only: the server rejected the previous profile and the next one is in use. |
|
|
195
198
|
| `session-wiped` | `(reason)` | The session folder was deleted (401, 411, corrupt state or pending pairing); 500 only if `wipeOnBadSession: true`. |
|
|
196
199
|
| `give-up` | `(message)` | The client stopped trying. Human intervention is needed (wrong number, blocked IP, …). |
|
|
@@ -204,7 +207,7 @@ Defaults are exported as `BIBZWHATS_DEFAULTS`.
|
|
|
204
207
|
| `client.identity` | `{ mode: 'auto' \| 'custom', source, profileId, browser, linkedDeviceName, pairingDisplay, pairingDisplayAccepted, tried: [{ id, reason }] }` |
|
|
205
208
|
| `client.options` | Effective options after defaults. |
|
|
206
209
|
| `client.isConnected()` | `true` while the socket is open. |
|
|
207
|
-
| `client.close()` | Close the socket and
|
|
210
|
+
| `await client.close()` | Close the socket, cancel reconnects and wait for already-triggered credential saves without logging out. Save errors are logged. |
|
|
208
211
|
| `client.logout()` | Log the device out on the server and delete the session folder. |
|
|
209
212
|
|
|
210
213
|
### Connection lifecycle
|
|
@@ -221,7 +224,7 @@ connect ──► QR / pairing code ──► 515 restartRequired ──► reco
|
|
|
221
224
|
Details worth knowing (the diagram shows defaults; `preserveSession: true` stops destructive recovery and retains auth files):
|
|
222
225
|
|
|
223
226
|
- **515 after pairing is normal.** The server asks the client to restart; the client reconnects after `restartDelayMs`.
|
|
224
|
-
- **401
|
|
227
|
+
- **401 after a pairing request.** If `401` follows a recently issued code before registration, the wrapper uses a `pairingPending` heuristic; the status alone does not establish the actual cause. By default it replaces credentials and requests another code without counting an ordinary wipe. Set `preserveSession: true` to stop destructive recovery and retain the files.
|
|
225
228
|
- **Identity rotation happens only before the device is registered.** Once linked, the identity is locked — changing it would look like a different device to the phone.
|
|
226
229
|
- **Session wipes keep `identity.json`** when the identity was already accepted (`qr-received`, `pairing-accepted`, `open`), so the device name stays the same after re-pairing.
|
|
227
230
|
|
|
@@ -318,6 +321,172 @@ import {
|
|
|
318
321
|
|
|
319
322
|
The raw `sock.sendMessage(jid, content)` exposes many message types, including: text, image, video, audio, document, sticker, sticker packs, location, contacts, polls, reactions, edits, deletes, pins, forwards, view-once, interactive buttons, product and event messages, newsletters. Builders `Button`, `Carousel` and `AIRich` are exported.
|
|
320
323
|
|
|
324
|
+
## Message recipes: buttons, location, images, and slides
|
|
325
|
+
|
|
326
|
+
These independent snippets use `sock` from `client.on('ready', ...)`, an authorized destination `jid`, and an incoming message as `incoming` where needed. Do not send all snippets at once. See the runnable [`example/message-recipes.js`](https://github.com/XbibzOfficial777/whatsbibz/blob/main/example/message-recipes.js) and the [complete message recipes guide](https://whatsbibz.xbibzclone.my.id/en/guide/message-recipes). The example file is in the repository, not the npm tarball.
|
|
327
|
+
|
|
328
|
+
From a repository checkout, run the example with your bot number and one private test chat you control (replace the placeholders):
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
npm ci
|
|
332
|
+
export WHATSAPP_PHONE='REPLACE_WITH_BOT_NUMBER'
|
|
333
|
+
export WHATSBIBZ_ALLOWED_JID='REPLACE_WITH_TEST_NUMBER@s.whatsapp.net'
|
|
334
|
+
export WHATSBIBZ_AUTH_DIR="$HOME/.whatsbibz/test-account"
|
|
335
|
+
node example/message-recipes.js
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Enter the pairing code in Linked devices, then send `!help` from a second authorized account. Add your own files under `example-media/` for media commands; the guide lists filenames and explains LID JIDs.
|
|
339
|
+
|
|
340
|
+
### Buttons, selection lists, and replies
|
|
341
|
+
|
|
342
|
+
```js
|
|
343
|
+
import { Button, extractMessage } from '@xbibzlibrary/whatsbibz';
|
|
344
|
+
|
|
345
|
+
await new Button(sock)
|
|
346
|
+
.setBody('Choose an action:')
|
|
347
|
+
.setFooter('Example bot')
|
|
348
|
+
.addReply('Status', 'menu_status')
|
|
349
|
+
.addReply('Help', 'menu_help')
|
|
350
|
+
.send(jid);
|
|
351
|
+
|
|
352
|
+
await new Button(sock)
|
|
353
|
+
.setBody('Choose a city:')
|
|
354
|
+
.addSelection('Open list')
|
|
355
|
+
.makeSection('Java')
|
|
356
|
+
.makeRow('', 'Jakarta', 'Jakarta', 'city_jakarta')
|
|
357
|
+
.makeRow('', 'Surabaya', 'East Java', 'city_surabaya')
|
|
358
|
+
.send(jid);
|
|
359
|
+
|
|
360
|
+
await new Button(sock)
|
|
361
|
+
.setBody('Example link and code')
|
|
362
|
+
.addUrl('Documentation', 'https://whatsbibz.xbibzclone.my.id/')
|
|
363
|
+
.addCopy('Copy code', 'WHATS-BIBZ')
|
|
364
|
+
.send(jid);
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Attach a listener for each socket `ready` to read quick-reply, list, and slide IDs. This example restricts one private chat: use the actual event JID (`@s.whatsapp.net` or `@lid`), not a guessed LID.
|
|
368
|
+
|
|
369
|
+
```js
|
|
370
|
+
const allowedJid = process.env.WHATSBIBZ_ALLOWED_JID;
|
|
371
|
+
const answers = new Map([
|
|
372
|
+
['menu_status', 'The example bot is available.'], ['menu_help', 'How can I help?'],
|
|
373
|
+
['city_jakarta', 'You selected Jakarta.'], ['city_surabaya', 'You selected Surabaya.'],
|
|
374
|
+
['image_detail', 'Image details selected.'],
|
|
375
|
+
['slide_one', 'First slide selected.'], ['slide_two', 'Second slide selected.'],
|
|
376
|
+
]);
|
|
377
|
+
client.on('ready', (sock) => {
|
|
378
|
+
sock.ev.on('messages.upsert', ({ messages = [], type }) => {
|
|
379
|
+
if (type !== 'notify') return;
|
|
380
|
+
for (const incoming of messages) {
|
|
381
|
+
const chat = incoming.key?.remoteJid;
|
|
382
|
+
if (!chat || chat !== allowedJid || incoming.key?.fromMe || !incoming.message) continue;
|
|
383
|
+
const item = extractMessage(incoming);
|
|
384
|
+
const answer = item?.type === 'button' ? answers.get(item.buttonId) : undefined;
|
|
385
|
+
if (answer) void sock.sendMessage(chat, { text: answer }, { quoted: incoming })
|
|
386
|
+
.catch((error) => console.error('Reply failed:', error.message));
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Allow-list IDs and authorize senders; never execute IDs as commands. URL/copy actions on the phone are not guaranteed to generate a reply event. In production add persistent deduplication, rate limits, and listener cleanup on reconnect.
|
|
393
|
+
|
|
394
|
+
### Image, image button, and slides
|
|
395
|
+
|
|
396
|
+
```js
|
|
397
|
+
import { readFile } from 'node:fs/promises';
|
|
398
|
+
import { Button, Carousel } from '@xbibzlibrary/whatsbibz';
|
|
399
|
+
|
|
400
|
+
const [first, second] = await Promise.all([
|
|
401
|
+
readFile('./example-media/gambar-1.jpg'), // your own JPEG files
|
|
402
|
+
readFile('./example-media/gambar-2.jpg'),
|
|
403
|
+
]);
|
|
404
|
+
await sock.sendMessage(jid, { image: first, mimetype: 'image/jpeg', caption: 'Example photo' });
|
|
405
|
+
await new Button(sock)
|
|
406
|
+
.setBody('View the photo:')
|
|
407
|
+
.setImage(first, { mimetype: 'image/jpeg' })
|
|
408
|
+
.addReply('Details', 'image_detail')
|
|
409
|
+
.send(jid);
|
|
410
|
+
await new Carousel(sock)
|
|
411
|
+
.setBody('Swipe through the options:')
|
|
412
|
+
.setFooter('Example bot')
|
|
413
|
+
.card((card) => card.image(first).title('Slide 1').text('First image').button('Choose 1', 'slide_one'))
|
|
414
|
+
.card((card) => card.image(second).title('Slide 2').text('Second image').button('Choose 2', 'slide_two'))
|
|
415
|
+
.send(jid);
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
Each carousel card needs header media; this example uses JPEG. Optional `sharp` can help with thumbnails. Validate file contents and size; do not fetch user-supplied URLs without validation and network egress controls.
|
|
419
|
+
|
|
420
|
+
### Location, poll, contact, and reaction
|
|
421
|
+
|
|
422
|
+
```js
|
|
423
|
+
await sock.sendMessage(jid, { location: {
|
|
424
|
+
degreesLatitude: -6.175392, degreesLongitude: 106.827153,
|
|
425
|
+
name: 'National Monument', address: 'Jakarta, Indonesia',
|
|
426
|
+
} }); // static point, not live tracking
|
|
427
|
+
await sock.sendMessage(jid, { poll: {
|
|
428
|
+
name: 'Choose a drink', values: ['Coffee', 'Tea'], selectableCount: 1,
|
|
429
|
+
} });
|
|
430
|
+
|
|
431
|
+
const number = process.env.CONTACT_PHONE || ''; // consenting contact's digits
|
|
432
|
+
if (!/^\d{8,15}$/.test(number)) throw new Error('CONTACT_PHONE must have 8–15 digits');
|
|
433
|
+
const vcard = `BEGIN:VCARD\nVERSION:3.0\nFN:Example contact\nTEL;type=CELL;type=VOICE;waid=${number}:+${number}\nEND:VCARD`;
|
|
434
|
+
await sock.sendMessage(jid, { contacts: {
|
|
435
|
+
displayName: 'Example contact', contacts: [{ displayName: 'Example contact', vcard }],
|
|
436
|
+
} });
|
|
437
|
+
await sock.sendMessage(jid, { react: { text: '✅', key: incoming.key } });
|
|
438
|
+
await sock.sendMessage(jid, { text: 'Thank you!' }, { quoted: incoming });
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
### Document, sticker, audio, and video
|
|
442
|
+
|
|
443
|
+
```js
|
|
444
|
+
import { readFile } from 'node:fs/promises';
|
|
445
|
+
|
|
446
|
+
await sock.sendMessage(jid, { document: await readFile('./example-media/contoh.pdf'),
|
|
447
|
+
mimetype: 'application/pdf', fileName: 'example.pdf', caption: 'Example document' });
|
|
448
|
+
await sock.sendMessage(jid, { sticker: await readFile('./example-media/stiker.webp'), mimetype: 'image/webp' });
|
|
449
|
+
await sock.sendMessage(jid, { audio: await readFile('./example-media/suara.ogg'),
|
|
450
|
+
mimetype: 'audio/ogg; codecs=opus', ptt: true }); // voice note; false for ordinary audio
|
|
451
|
+
await sock.sendMessage(jid, { video: await readFile('./example-media/video.mp4'),
|
|
452
|
+
mimetype: 'video/mp4', caption: 'Example video' });
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
Provide valid media: extensions and MIME labels do not convert files. Support varies by WhatsApp client. An API return or server ACK is **not** evidence of rendering, reading, or a click. Builder-carousel clicks were observed in an earlier test; rich R01–R11 rendering remains unconfirmed. See the [complete guide](https://whatsbibz.xbibzclone.my.id/en/guide/message-recipes) and the rich section below.
|
|
456
|
+
|
|
457
|
+
## Sound sticker from a video reply (experimental)
|
|
458
|
+
|
|
459
|
+
> **Status:** helpers are included in package 2.1.0; they are not in 2.0.0. The sample bot below is in the repository only. Rendering and playback depend on the recipient's WhatsApp account and version.
|
|
460
|
+
|
|
461
|
+
1. Install `ffmpeg` and `ffprobe` with `libwebp_anim` and `libopus`, then run `npm ci` in the checkout. Use a normal, audible MP4/MOV video up to **20 MiB**; view-once is rejected.
|
|
462
|
+
2. For self-chat, replace the digits below with the bot's number. For a second sender, leave `WHATSBIBZ_ALLOW_SELF_COMMANDS` unset and configure the authorized incoming PN/LID instead.
|
|
463
|
+
3. Pair if prompted, wait for **Socket siap** (ready), and **reply to the video with `.sa`**. Aliases are `!soundsticker` and `!sticker-audio`. Tap the sticker's sound icon if needed.
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
export WHATSAPP_PHONE='6281234567890' # replace with your bot number
|
|
467
|
+
export WHATSBIBZ_ALLOWED_JID="${WHATSAPP_PHONE}@s.whatsapp.net"
|
|
468
|
+
export WHATSBIBZ_ALLOW_SELF_COMMANDS=1
|
|
469
|
+
export WHATSBIBZ_AUTH_DIR="$HOME/.whatsbibz/my-bot-session"
|
|
470
|
+
mkdir -p "$WHATSBIBZ_AUTH_DIR" && chmod 700 "$WHATSBIBZ_AUTH_DIR"
|
|
471
|
+
node example/message-recipes.js
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
Reuse the same private session directory and stop normally; `preserveSession: true` prevents certain automatic wipes, but WhatsApp may still revoke the session. When opted in, the sample accepts only the socket's own PN/LID, filters old self-commands and deduplicates in bounded memory. Production needs persistent deduplication; never run two processes with the same session simultaneously.
|
|
475
|
+
|
|
476
|
+
In your own application, install package 2.1.0 and call the helpers from an **authorized handler**. `incoming` is the reply to the video:
|
|
477
|
+
|
|
478
|
+
```js
|
|
479
|
+
import { downloadVideoForSoundSticker, sendVideoAsSoundSticker } from '@xbibzlibrary/whatsbibz';
|
|
480
|
+
|
|
481
|
+
const video = await downloadVideoForSoundSticker(incoming, { mediaHost: sock.getMediaHost() });
|
|
482
|
+
const sent = await sendVideoAsSoundSticker(sock, incoming.key.remoteJid, video, { quoted: incoming, startSeconds: 0 });
|
|
483
|
+
console.log('Message created:', sent.key.id); // not proof of playback
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
WebP alone cannot carry sound: the helper uploads animated WebP and Ogg Opus separately, then sends **one** `audioStickerMessage`. It selects at most 5 seconds, 512 × 512, WebP ≤ 500 KiB; these are implementation choices, not official WhatsApp limits. Missing or silent audio fails instead of silently falling back. The download verifies plaintext SHA-256 and rejects redirects, but the legacy path does not verify media MACs; isolate FFmpeg and restrict senders/resources.
|
|
487
|
+
|
|
488
|
+
In one authorized live test, the replied-to sticker received a server ACK and its owner confirmed **both display and sound**. This does not guarantee support on other clients. See the **[complete guide and troubleshooting](https://whatsbibz.xbibzclone.my.id/en/guide/sound-sticker)**.
|
|
489
|
+
|
|
321
490
|
## Text formatting and chat markup
|
|
322
491
|
|
|
323
492
|
### 1) Native WhatsApp formatting (raw, no conversion)
|
|
@@ -379,7 +548,7 @@ await sock.sendMessage(groupJid, {
|
|
|
379
548
|
|
|
380
549
|
## Interactive buttons
|
|
381
550
|
|
|
382
|
-
|
|
551
|
+
**Native flow** buttons use markup `{ name, buttonParamsJson }`; use the `Button` builder or `sock.sendMessage(jid, { interactiveMessage: {...} })`. `ButtonV2` below uses the older `buttonsMessage` format, not native flow. Support varies by WhatsApp client.
|
|
383
552
|
|
|
384
553
|
### Way 1 — Native flow (recommended) via `sendMessage`
|
|
385
554
|
|
|
@@ -530,7 +699,11 @@ Chainable `AIRich` methods: `addText(text)`, `addTable(array2dOfStrings)`, `addC
|
|
|
530
699
|
|
|
531
700
|
### Ethical usage note
|
|
532
701
|
|
|
533
|
-
These rich/AI messages
|
|
702
|
+
These rich/AI messages use internal schemas (`forwardedAiBotMessageInfo`, `GenAI*` view models, etc.) and **may** appear as forwarded AI content; rendering of the tested rich variants remains unconfirmed. Clearly label messages as your own bot and never impersonate Meta AI or anyone else. This is an **unofficial** WhatsApp client; be aware of the risk of WhatsApp restricting the account.
|
|
703
|
+
|
|
704
|
+
## Experimental voice calls
|
|
705
|
+
|
|
706
|
+
`VoipClient` requires `@roamhq/wrtc` and FFmpeg. Call only consenting recipients and use audio you are licensed to play. One live test before the latest changes rang but failed with `ICE_FAILED` and no audible audio; subsequent changes have only been tested offline and **do not prove a real call works**. See the [VoIP guide, diagnostics, and one-call example](https://whatsbibz.xbibzclone.my.id/en/guide/voip) for timeouts and session safety.
|
|
534
707
|
|
|
535
708
|
## Low-level API (Baileys-compatible)
|
|
536
709
|
|
|
@@ -563,7 +736,7 @@ client.on('identity-changed', (i) => console.log(i.linkedDeviceName));
|
|
|
563
736
|
|
|
564
737
|
## Migrating from Baileys
|
|
565
738
|
|
|
566
|
-
1. `npm uninstall baileys && npm install @xbibzlibrary/whatsbibz@2.
|
|
739
|
+
1. `npm uninstall baileys && npm install @xbibzlibrary/whatsbibz@2.1.0` (or install a local checkout).
|
|
567
740
|
2. Replace the import specifier and test the APIs and behavior your application uses.
|
|
568
741
|
3. Remove any `postinstall` patch scripts for `companion_reg_refresh` — the handler is built in.
|
|
569
742
|
4. Optional: replace your own connect/reconnect/pairing loop with `createBibzWhats()`.
|
|
@@ -575,11 +748,11 @@ client.on('identity-changed', (i) => console.log(i.linkedDeviceName));
|
|
|
575
748
|
| Pairing code printed, phone shows no notification | The server ACK confirms the pairing request, not notification delivery or a linked device. A missing notification alone does not prove an incorrect number or a rate-limited IP. | On the phone, open **Linked devices → Link a device → Link with phone number instead** and enter the latest code. Check the number and connectivity; avoid repeated requests, particularly after `429`. |
|
|
576
749
|
| `428` immediately, no QR | The advertised identity is refused (e.g. `DARWIN` sub-platform). | Leave `identity` unset (auto rotates), or pick a profile from the table above. |
|
|
577
750
|
| `400 bad-request` at pairing | `companion_platform_display` not on the allow-list. | Don't override `companionPlatformDisplay`; the derived value is always valid. |
|
|
578
|
-
| `401` right after a reconnect while pairing |
|
|
751
|
+
| `401` right after a reconnect while pairing | Cause unknown; `pairingPending` is only a heuristic. | Default recovery may replace the session; `preserveSession: true` stops destructive recovery. |
|
|
579
752
|
| `408` loop | WhatsApp Web version too old. | Keep `fetchLatestVersion: true` (default) or update the package. |
|
|
580
|
-
| `give-up` after
|
|
753
|
+
| `give-up` after several session wipes | The server still rejects the connection; the cause is unknown. | Check account, session, number and network; avoid repeated pairing attempts. |
|
|
581
754
|
| Handlers stop working after a reconnect | Handlers were attached to the old socket. | Attach them inside `client.on('ready', sock => …)`. |
|
|
582
|
-
| Process won't exit |
|
|
755
|
+
| Process won't exit | A socket, worker, or application timer may still be active. | Await `client.close()` and release your own intervals and resources before exiting. |
|
|
583
756
|
|
|
584
757
|
## Testing
|
|
585
758
|
|
|
@@ -607,7 +780,7 @@ test/ node:test suites (offline + live)
|
|
|
607
780
|
|
|
608
781
|
## Versioning and compatibility
|
|
609
782
|
|
|
610
|
-
- Version 2.0.0
|
|
783
|
+
- Version 2.0.0 changed account behavior by attempting auto-follow by default; 2.1.0 restricts its automatic target to one channel and rejects other automatic JIDs. Sound stickers and VoIP are experimental.
|
|
611
784
|
- The high-level wrapper fetches the WhatsApp Web revision on connect unless disabled or explicitly pinned; the low-level socket uses its configured/fallback version without automatically fetching.
|
|
612
785
|
- Node 20 is EOL. See [SECURITY.md](SECURITY.md) for the patched supported Node lines.
|
|
613
786
|
- Changes and limitations: [CHANGELOG.md](CHANGELOG.md), [compatibility report](KOMPATIBILITAS-WHATSAPP-2026-11.md).
|
package/SECURITY.md
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
| Version | Supported |
|
|
8
8
|
|---|---|
|
|
9
|
-
| 2.
|
|
10
|
-
| < 2.
|
|
9
|
+
| 2.1.x (latest release) | Yes |
|
|
10
|
+
| < 2.1.0 | No — upgrade to the latest release |
|
|
11
11
|
|
|
12
12
|
Only the latest release receives security fixes. The [November 11, 2026 Node.js security release](https://nodejs.org/en/blog/vulnerability/november-2026-security-releases) fixes vulnerabilities on the supported lines. For production, use at least **22.23.5 on 22.x, 24.22.3 on 24.x, or 26.13.1 on 26.x**, and keep following later security releases. Node 20 is end-of-life. The October JavaScript helpers (`safeFetch`, `assertSafeUrl`, `withSafeFetchHeaders`) provide only partial defense in the code paths that call them; they do not replace patched Node.js, prevent all Brotli-related failures, or fix the November vulnerabilities.
|
|
13
13
|
|
|
14
|
-
**Untrusted media URLs can cause SSRF.** When a `directPath` is present this checkout uses a constrained WhatsApp/Meta host selection unless the application explicitly overrides it. The legacy URL-only path remains compatible with arbitrary URLs; redirects and DNS/egress are not constrained by this selection. `safeFetch` checks the final response URL only *after* automatic redirects have been contacted. Validate media metadata and
|
|
14
|
+
**Untrusted media and preview URLs can cause SSRF.** When a `directPath` is present this checkout uses a constrained WhatsApp/Meta host selection unless the application explicitly overrides it. The legacy URL-only path remains compatible with arbitrary URLs; redirects and DNS/egress are not constrained by this selection. `safeFetch` checks the final response URL only *after* automatic redirects have been contacted. The optional `link-preview-js` peer now requires 4.0.4 or later within 4.x due to known advisories; `getUrlInfo` uses manual same-host redirects but does not itself pin or filter DNS by default, and preview images use another fetch path. Validate media metadata and URLs before access and enforce outbound network restrictions (including DNS/private-address controls), deadlines and size limits at the application/network layer. Do not treat any helper as a complete SSRF boundary.
|
|
15
15
|
|
|
16
16
|
**Media integrity:** the inherited `downloadEncryptedContent` decrypts and streams data but does not verify the trailing media MAC or message hashes. Streaming plaintext may be delivered before application validation. Do not treat downloaded media as authenticated on that basis; verify an independently trusted digest before processing or use a separately authenticated media implementation.
|
|
17
17
|
|
|
@@ -58,12 +58,12 @@ Out of scope: WhatsApp server behaviour, account bans, rate limits, and issues i
|
|
|
58
58
|
|
|
59
59
|
| Versi | Didukung |
|
|
60
60
|
|---|---|
|
|
61
|
-
| 2.
|
|
62
|
-
| < 2.
|
|
61
|
+
| 2.1.x (rilis terbaru) | Ya |
|
|
62
|
+
| < 2.1.0 | Tidak — perbarui ke rilis terbaru |
|
|
63
63
|
|
|
64
64
|
Hanya rilis terbaru yang menerima perbaikan keamanan. [Rilis keamanan Node.js 11 November 2026](https://nodejs.org/en/blog/vulnerability/november-2026-security-releases) memperbaiki kerentanan pada lini yang didukung. Untuk produksi, gunakan minimal **22.23.5 pada 22.x, 24.22.3 pada 24.x, atau 26.13.1 pada 26.x**, lalu ikuti rilis keamanan berikutnya. Node 20 sudah EOL. Helper JavaScript Oktober (`safeFetch`, `assertSafeUrl`, `withSafeFetchHeaders`) hanya memberi pertahanan parsial pada jalur yang memakainya; bukan pengganti Node yang dipatch, bukan jaminan mencegah semua masalah Brotli, dan tidak memperbaiki kerentanan November.
|
|
65
65
|
|
|
66
|
-
**URL media tak tepercaya dapat menimbulkan SSRF.** Dengan `directPath`, checkout ini membatasi pemilihan host WhatsApp/Meta kecuali aplikasi secara eksplisit override. Jalur legacy yang hanya memiliki URL masih menerima URL arbitrary; redirect dan DNS/egress tidak dibatasi oleh pemilihan host tersebut. `safeFetch` memeriksa URL respons akhir hanya *setelah* redirect otomatis diakses. Validasi metadata
|
|
66
|
+
**URL media dan preview tak tepercaya dapat menimbulkan SSRF.** Dengan `directPath`, checkout ini membatasi pemilihan host WhatsApp/Meta kecuali aplikasi secara eksplisit override. Jalur legacy yang hanya memiliki URL masih menerima URL arbitrary; redirect dan DNS/egress tidak dibatasi oleh pemilihan host tersebut. `safeFetch` memeriksa URL respons akhir hanya *setelah* redirect otomatis diakses. Peer opsional `link-preview-js` kini memerlukan 4.0.4 atau lebih baru dalam 4.x karena advisory; `getUrlInfo` memakai redirect manual ke host yang sama, tetapi tidak melakukan pin/filter DNS secara default dan gambar preview memakai jalur unduhan lain. Validasi metadata dan URL sebelum akses, dan terapkan pembatasan jaringan keluar (termasuk DNS/alamat privat), timeout, serta batas ukuran pada aplikasi/jaringan. Jangan menganggap helper sebagai perlindungan SSRF menyeluruh.
|
|
67
67
|
|
|
68
68
|
**Integritas media:** `downloadEncryptedContent` bawaan mendekripsi dan melakukan streaming, tetapi belum memverifikasi MAC media di akhir maupun hash pesan. Plaintext stream dapat diterima sebelum validasi oleh aplikasi. Jangan menganggap hasil unduhan terautentikasi hanya berdasarkan helper ini; verifikasi digest yang tepercaya sebelum memproses atau gunakan implementasi media terautentikasi terpisah.
|
|
69
69
|
|
package/WAProto/WAProto.proto
CHANGED
|
@@ -2349,6 +2349,7 @@ message Message {
|
|
|
2349
2349
|
optional PollAddOptionMessage pollAddOptionMessage = 121;
|
|
2350
2350
|
optional EventInviteMessage eventInviteMessage = 122;
|
|
2351
2351
|
optional GroupRootKeyShare groupRootKeyShare = 123;
|
|
2352
|
+
optional FutureProofMessage audioStickerMessage = 134;
|
|
2352
2353
|
message AlbumMessage {
|
|
2353
2354
|
optional uint32 expectedImageCount = 2;
|
|
2354
2355
|
optional uint32 expectedVideoCount = 3;
|
|
@@ -3809,6 +3810,9 @@ message Message {
|
|
|
3809
3810
|
optional string accessibilityLabel = 22;
|
|
3810
3811
|
optional int32 premium = 24;
|
|
3811
3812
|
optional string emojis = 25;
|
|
3813
|
+
oneof audio {
|
|
3814
|
+
Message.AudioMessage audioMessage = 26;
|
|
3815
|
+
}
|
|
3812
3816
|
}
|
|
3813
3817
|
|
|
3814
3818
|
message StickerPackMessage {
|
package/WAProto/index.d.ts
CHANGED
|
@@ -5726,6 +5726,7 @@ export namespace proto {
|
|
|
5726
5726
|
pollAddOptionMessage?: (proto.Message.IPollAddOptionMessage|null);
|
|
5727
5727
|
eventInviteMessage?: (proto.Message.IEventInviteMessage|null);
|
|
5728
5728
|
groupRootKeyShare?: (proto.IGroupRootKeyShare|null);
|
|
5729
|
+
audioStickerMessage?: (proto.Message.IFutureProofMessage|null);
|
|
5729
5730
|
}
|
|
5730
5731
|
|
|
5731
5732
|
class Message implements IMessage {
|
|
@@ -5833,6 +5834,7 @@ export namespace proto {
|
|
|
5833
5834
|
public pollAddOptionMessage?: (proto.Message.IPollAddOptionMessage|null);
|
|
5834
5835
|
public eventInviteMessage?: (proto.Message.IEventInviteMessage|null);
|
|
5835
5836
|
public groupRootKeyShare?: (proto.IGroupRootKeyShare|null);
|
|
5837
|
+
public audioStickerMessage?: (proto.Message.IFutureProofMessage|null);
|
|
5836
5838
|
public static create(properties?: proto.IMessage): proto.Message;
|
|
5837
5839
|
public static encode(m: proto.IMessage, w?: $protobuf.Writer): $protobuf.Writer;
|
|
5838
5840
|
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message;
|
|
@@ -9773,6 +9775,7 @@ export namespace proto {
|
|
|
9773
9775
|
accessibilityLabel?: (string|null);
|
|
9774
9776
|
premium?: (number|null);
|
|
9775
9777
|
emojis?: (string|null);
|
|
9778
|
+
audioMessage?: (proto.Message.IAudioMessage|null);
|
|
9776
9779
|
}
|
|
9777
9780
|
|
|
9778
9781
|
class StickerMessage implements IStickerMessage {
|
|
@@ -9799,6 +9802,8 @@ export namespace proto {
|
|
|
9799
9802
|
public accessibilityLabel?: (string|null);
|
|
9800
9803
|
public premium?: (number|null);
|
|
9801
9804
|
public emojis?: (string|null);
|
|
9805
|
+
public audioMessage?: (proto.Message.IAudioMessage|null);
|
|
9806
|
+
public audio?: "audioMessage";
|
|
9802
9807
|
public static create(properties?: proto.Message.IStickerMessage): proto.Message.StickerMessage;
|
|
9803
9808
|
public static encode(m: proto.Message.IStickerMessage, w?: $protobuf.Writer): $protobuf.Writer;
|
|
9804
9809
|
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.StickerMessage;
|
package/WAProto/index.js
CHANGED
|
@@ -47483,6 +47483,7 @@ export const proto = $root.proto = (() => {
|
|
|
47483
47483
|
Message.prototype.pollAddOptionMessage = null;
|
|
47484
47484
|
Message.prototype.eventInviteMessage = null;
|
|
47485
47485
|
Message.prototype.groupRootKeyShare = null;
|
|
47486
|
+
Message.prototype.audioStickerMessage = null;
|
|
47486
47487
|
|
|
47487
47488
|
let $oneOfFields;
|
|
47488
47489
|
|
|
@@ -48104,6 +48105,12 @@ export const proto = $root.proto = (() => {
|
|
|
48104
48105
|
set: $util.oneOfSetter($oneOfFields)
|
|
48105
48106
|
});
|
|
48106
48107
|
|
|
48108
|
+
// Virtual OneOf for proto3 optional field
|
|
48109
|
+
Object.defineProperty(Message.prototype, "_audioStickerMessage", {
|
|
48110
|
+
get: $util.oneOfGetter($oneOfFields = ["audioStickerMessage"]),
|
|
48111
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
48112
|
+
});
|
|
48113
|
+
|
|
48107
48114
|
Message.create = function create(properties) {
|
|
48108
48115
|
return new Message(properties);
|
|
48109
48116
|
};
|
|
@@ -48317,6 +48324,8 @@ export const proto = $root.proto = (() => {
|
|
|
48317
48324
|
$root.proto.Message.EventInviteMessage.encode(message.eventInviteMessage, writer.uint32(978).fork()).ldelim();
|
|
48318
48325
|
if (message.groupRootKeyShare != null && Object.hasOwnProperty.call(message, "groupRootKeyShare"))
|
|
48319
48326
|
$root.proto.GroupRootKeyShare.encode(message.groupRootKeyShare, writer.uint32(986).fork()).ldelim();
|
|
48327
|
+
if (message.audioStickerMessage != null && Object.hasOwnProperty.call(message, "audioStickerMessage"))
|
|
48328
|
+
$root.proto.Message.FutureProofMessage.encode(message.audioStickerMessage, writer.uint32(1074).fork()).ldelim();
|
|
48320
48329
|
return writer;
|
|
48321
48330
|
};
|
|
48322
48331
|
|
|
@@ -48745,6 +48754,10 @@ export const proto = $root.proto = (() => {
|
|
|
48745
48754
|
message.groupRootKeyShare = $root.proto.GroupRootKeyShare.decode(reader, reader.uint32());
|
|
48746
48755
|
break;
|
|
48747
48756
|
}
|
|
48757
|
+
case 134: {
|
|
48758
|
+
message.audioStickerMessage = $root.proto.Message.FutureProofMessage.decode(reader, reader.uint32());
|
|
48759
|
+
break;
|
|
48760
|
+
}
|
|
48748
48761
|
default:
|
|
48749
48762
|
reader.skipType(tag & 7);
|
|
48750
48763
|
break;
|
|
@@ -49584,6 +49597,14 @@ export const proto = $root.proto = (() => {
|
|
|
49584
49597
|
return "groupRootKeyShare." + error;
|
|
49585
49598
|
}
|
|
49586
49599
|
}
|
|
49600
|
+
if (message.audioStickerMessage != null && message.hasOwnProperty("audioStickerMessage")) {
|
|
49601
|
+
properties._audioStickerMessage = 1;
|
|
49602
|
+
{
|
|
49603
|
+
let error = $root.proto.Message.FutureProofMessage.verify(message.audioStickerMessage);
|
|
49604
|
+
if (error)
|
|
49605
|
+
return "audioStickerMessage." + error;
|
|
49606
|
+
}
|
|
49607
|
+
}
|
|
49587
49608
|
return null;
|
|
49588
49609
|
};
|
|
49589
49610
|
|
|
@@ -50103,6 +50124,11 @@ export const proto = $root.proto = (() => {
|
|
|
50103
50124
|
throw TypeError(".proto.Message.groupRootKeyShare: object expected");
|
|
50104
50125
|
message.groupRootKeyShare = $root.proto.GroupRootKeyShare.fromObject(object.groupRootKeyShare);
|
|
50105
50126
|
}
|
|
50127
|
+
if (object.audioStickerMessage != null) {
|
|
50128
|
+
if (typeof object.audioStickerMessage !== "object")
|
|
50129
|
+
throw TypeError(".proto.Message.audioStickerMessage: object expected");
|
|
50130
|
+
message.audioStickerMessage = $root.proto.Message.FutureProofMessage.fromObject(object.audioStickerMessage);
|
|
50131
|
+
}
|
|
50106
50132
|
return message;
|
|
50107
50133
|
};
|
|
50108
50134
|
|
|
@@ -50625,6 +50651,11 @@ export const proto = $root.proto = (() => {
|
|
|
50625
50651
|
if (options.oneofs)
|
|
50626
50652
|
object._groupRootKeyShare = "groupRootKeyShare";
|
|
50627
50653
|
}
|
|
50654
|
+
if (message.audioStickerMessage != null && message.hasOwnProperty("audioStickerMessage")) {
|
|
50655
|
+
object.audioStickerMessage = $root.proto.Message.FutureProofMessage.toObject(message.audioStickerMessage, options);
|
|
50656
|
+
if (options.oneofs)
|
|
50657
|
+
object._audioStickerMessage = "audioStickerMessage";
|
|
50658
|
+
}
|
|
50628
50659
|
return object;
|
|
50629
50660
|
};
|
|
50630
50661
|
|
|
@@ -84220,6 +84251,7 @@ export const proto = $root.proto = (() => {
|
|
|
84220
84251
|
StickerMessage.prototype.accessibilityLabel = null;
|
|
84221
84252
|
StickerMessage.prototype.premium = null;
|
|
84222
84253
|
StickerMessage.prototype.emojis = null;
|
|
84254
|
+
StickerMessage.prototype.audioMessage = null;
|
|
84223
84255
|
|
|
84224
84256
|
let $oneOfFields;
|
|
84225
84257
|
|
|
@@ -84355,6 +84387,11 @@ export const proto = $root.proto = (() => {
|
|
|
84355
84387
|
set: $util.oneOfSetter($oneOfFields)
|
|
84356
84388
|
});
|
|
84357
84389
|
|
|
84390
|
+
Object.defineProperty(StickerMessage.prototype, "audio", {
|
|
84391
|
+
get: $util.oneOfGetter($oneOfFields = ["audioMessage"]),
|
|
84392
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
84393
|
+
});
|
|
84394
|
+
|
|
84358
84395
|
StickerMessage.create = function create(properties) {
|
|
84359
84396
|
return new StickerMessage(properties);
|
|
84360
84397
|
};
|
|
@@ -84406,6 +84443,8 @@ export const proto = $root.proto = (() => {
|
|
|
84406
84443
|
writer.uint32(192).int32(message.premium);
|
|
84407
84444
|
if (message.emojis != null && Object.hasOwnProperty.call(message, "emojis"))
|
|
84408
84445
|
writer.uint32(202).string(message.emojis);
|
|
84446
|
+
if (message.audioMessage != null && Object.hasOwnProperty.call(message, "audioMessage"))
|
|
84447
|
+
$root.proto.Message.AudioMessage.encode(message.audioMessage, writer.uint32(210).fork()).ldelim();
|
|
84409
84448
|
return writer;
|
|
84410
84449
|
};
|
|
84411
84450
|
|
|
@@ -84510,6 +84549,10 @@ export const proto = $root.proto = (() => {
|
|
|
84510
84549
|
message.emojis = reader.string();
|
|
84511
84550
|
break;
|
|
84512
84551
|
}
|
|
84552
|
+
case 26: {
|
|
84553
|
+
message.audioMessage = $root.proto.Message.AudioMessage.decode(reader, reader.uint32());
|
|
84554
|
+
break;
|
|
84555
|
+
}
|
|
84513
84556
|
default:
|
|
84514
84557
|
reader.skipType(tag & 7);
|
|
84515
84558
|
break;
|
|
@@ -84641,6 +84684,14 @@ export const proto = $root.proto = (() => {
|
|
|
84641
84684
|
if (!$util.isString(message.emojis))
|
|
84642
84685
|
return "emojis: string expected";
|
|
84643
84686
|
}
|
|
84687
|
+
if (message.audioMessage != null && message.hasOwnProperty("audioMessage")) {
|
|
84688
|
+
properties.audio = 1;
|
|
84689
|
+
{
|
|
84690
|
+
let error = $root.proto.Message.AudioMessage.verify(message.audioMessage);
|
|
84691
|
+
if (error)
|
|
84692
|
+
return "audioMessage." + error;
|
|
84693
|
+
}
|
|
84694
|
+
}
|
|
84644
84695
|
return null;
|
|
84645
84696
|
};
|
|
84646
84697
|
|
|
@@ -84731,6 +84782,11 @@ export const proto = $root.proto = (() => {
|
|
|
84731
84782
|
message.premium = object.premium | 0;
|
|
84732
84783
|
if (object.emojis != null)
|
|
84733
84784
|
message.emojis = String(object.emojis);
|
|
84785
|
+
if (object.audioMessage != null) {
|
|
84786
|
+
if (typeof object.audioMessage !== "object")
|
|
84787
|
+
throw TypeError(".proto.Message.StickerMessage.audioMessage: object expected");
|
|
84788
|
+
message.audioMessage = $root.proto.Message.AudioMessage.fromObject(object.audioMessage);
|
|
84789
|
+
}
|
|
84734
84790
|
return message;
|
|
84735
84791
|
};
|
|
84736
84792
|
|
|
@@ -84857,6 +84913,11 @@ export const proto = $root.proto = (() => {
|
|
|
84857
84913
|
if (options.oneofs)
|
|
84858
84914
|
object._emojis = "emojis";
|
|
84859
84915
|
}
|
|
84916
|
+
if (message.audioMessage != null && message.hasOwnProperty("audioMessage")) {
|
|
84917
|
+
object.audioMessage = $root.proto.Message.AudioMessage.toObject(message.audioMessage, options);
|
|
84918
|
+
if (options.oneofs)
|
|
84919
|
+
object.audio = "audioMessage";
|
|
84920
|
+
}
|
|
84860
84921
|
return object;
|
|
84861
84922
|
};
|
|
84862
84923
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/** @module @xbibzlibrary/whatsbibz/lib/BibzWhats/banner */
|
|
2
2
|
/**
|
|
3
|
-
* Banner ASCII
|
|
4
|
-
* Huruf: "Small Slant" (figlet). Warna: filter pelangi (Rainbow 2).
|
|
3
|
+
* Banner ASCII Small Slant dengan versi paket dan warna pelangi.
|
|
5
4
|
*/
|
|
6
5
|
|
|
7
6
|
export const BANNER_FONT: string;
|
|
8
7
|
export const BANNER_FILTER: string;
|
|
9
8
|
|
|
10
|
-
/** Banner polos tanpa kode
|
|
9
|
+
/** Banner polos dengan versi paket, tanpa kode ANSI atau newline tambahan. */
|
|
11
10
|
export const BANNER_TEXT: string;
|
|
12
11
|
|
|
13
12
|
export interface BannerRenderOptions {
|
|
@@ -30,3 +29,6 @@ export function renderBanner(options?: BannerRenderOptions): string;
|
|
|
30
29
|
export function printBanner(
|
|
31
30
|
options?: BannerRenderOptions & { write?: (chunk: string) => void },
|
|
32
31
|
): boolean;
|
|
32
|
+
|
|
33
|
+
/** @internal Prints the automatic startup banner once per process on stderr. */
|
|
34
|
+
export function printAutomaticBanner(enabled?: boolean, options?: { env?: NodeJS.ProcessEnv; stream?: NodeJS.WritableStream }): boolean;
|