@xbibzlibrary/whatsbibz 1.3.2 → 1.4.3
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/CHANGELOG.md +31 -1
- package/README.cn.md +604 -0
- package/README.id.md +237 -7
- package/README.md +237 -7
- package/WAProto/WAProto.proto +1 -0
- package/WAProto/index.d.ts +1 -0
- package/WAProto/index.js +1 -0
- package/assets/logo/README.md +11 -13
- package/assets/logo/preview.png +0 -0
- package/lib/BibzWhats/banner.d.ts +32 -0
- package/lib/BibzWhats/banner.js +121 -0
- package/lib/BibzWhats/client.d.ts +8 -1
- package/lib/BibzWhats/client.js +13 -0
- package/lib/BibzWhats/device-identity.d.ts +1 -0
- package/lib/BibzWhats/device-identity.js +1 -0
- package/lib/BibzWhats/extract.d.ts +1 -0
- package/lib/BibzWhats/extract.js +1 -0
- package/lib/BibzWhats/index.d.ts +2 -0
- package/lib/BibzWhats/index.js +2 -0
- package/lib/BibzWhats/jid.d.ts +1 -0
- package/lib/BibzWhats/jid.js +1 -0
- package/lib/BibzWhats/pairing.d.ts +1 -0
- package/lib/BibzWhats/pairing.js +1 -0
- package/lib/BibzWhats/send.d.ts +1 -0
- package/lib/BibzWhats/send.js +1 -0
- package/lib/BibzWhats/version.js +5 -4
- package/lib/Defaults/index.d.ts +3 -0
- package/lib/Defaults/index.js +4 -6
- package/lib/Modded/message_builder.d.ts +1 -0
- package/lib/Modded/message_builder.js +36 -43
- package/lib/Signal/Group/ciphertext-message.d.ts +1 -0
- package/lib/Signal/Group/ciphertext-message.js +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +1 -0
- package/lib/Signal/Group/group-session-builder.js +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +1 -0
- package/lib/Signal/Group/group_cipher.js +1 -0
- package/lib/Signal/Group/index.d.ts +1 -0
- package/lib/Signal/Group/index.js +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +1 -0
- package/lib/Signal/Group/keyhelper.js +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +1 -0
- package/lib/Signal/Group/sender-chain-key.js +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +1 -0
- package/lib/Signal/Group/sender-key-message.js +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +1 -0
- package/lib/Signal/Group/sender-key-name.js +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +1 -0
- package/lib/Signal/Group/sender-key-record.js +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +1 -0
- package/lib/Signal/Group/sender-key-state.js +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +1 -0
- package/lib/Signal/Group/sender-message-key.js +1 -0
- package/lib/Signal/libsignal.d.ts +1 -0
- package/lib/Signal/libsignal.js +1 -0
- package/lib/Signal/lid-mapping.d.ts +1 -0
- package/lib/Signal/lid-mapping.js +1 -0
- package/lib/Socket/Client/index.d.ts +1 -0
- package/lib/Socket/Client/index.js +1 -0
- package/lib/Socket/Client/types.d.ts +1 -0
- package/lib/Socket/Client/types.js +1 -0
- package/lib/Socket/Client/websocket.d.ts +1 -0
- package/lib/Socket/Client/websocket.js +1 -0
- package/lib/Socket/business.d.ts +1 -2
- package/lib/Socket/business.js +1 -0
- package/lib/Socket/chats.d.ts +1 -0
- package/lib/Socket/chats.js +1 -0
- package/lib/Socket/communities.d.ts +1 -2
- package/lib/Socket/communities.js +12 -2
- package/lib/Socket/engine.d.ts +1 -0
- package/lib/Socket/engine.js +1 -0
- package/lib/Socket/groups.d.ts +1 -0
- package/lib/Socket/groups.js +1 -0
- package/lib/Socket/index.d.ts +1 -2
- package/lib/Socket/index.js +12 -11
- package/lib/Socket/messages-recv.d.ts +1 -2
- package/lib/Socket/messages-recv.js +13 -4
- package/lib/Socket/messages-send.d.ts +7 -2
- package/lib/Socket/messages-send.js +59 -23
- package/lib/Socket/mex.d.ts +1 -0
- package/lib/Socket/mex.js +1 -0
- package/lib/Socket/newsletter.d.ts +1 -1
- package/lib/Socket/newsletter.js +255 -432
- package/lib/Socket/socket.d.ts +1 -0
- package/lib/Socket/socket.js +20 -1
- package/lib/Types/Auth.d.ts +2 -0
- package/lib/Types/Auth.js +1 -0
- package/lib/Types/Bussines.d.ts +1 -0
- package/lib/Types/Bussines.js +1 -0
- package/lib/Types/Call.d.ts +1 -0
- package/lib/Types/Call.js +1 -0
- package/lib/Types/Chat.d.ts +1 -0
- package/lib/Types/Chat.js +1 -0
- package/lib/Types/Contact.d.ts +1 -0
- package/lib/Types/Contact.js +1 -0
- package/lib/Types/Events.d.ts +1 -0
- package/lib/Types/Events.js +1 -0
- package/lib/Types/GroupMetadata.d.ts +1 -0
- package/lib/Types/GroupMetadata.js +1 -0
- package/lib/Types/Label.d.ts +1 -0
- package/lib/Types/Label.js +1 -0
- package/lib/Types/LabelAssociation.d.ts +1 -0
- package/lib/Types/LabelAssociation.js +1 -0
- package/lib/Types/Message.d.ts +1 -0
- package/lib/Types/Message.js +1 -0
- package/lib/Types/Newsletter.d.ts +1 -0
- package/lib/Types/Newsletter.js +1 -0
- package/lib/Types/Product.d.ts +1 -0
- package/lib/Types/Product.js +1 -0
- package/lib/Types/Signal.d.ts +1 -0
- package/lib/Types/Signal.js +1 -0
- package/lib/Types/Socket.d.ts +1 -6
- package/lib/Types/Socket.js +1 -0
- package/lib/Types/State.d.ts +1 -0
- package/lib/Types/State.js +1 -0
- package/lib/Types/USync.d.ts +1 -0
- package/lib/Types/USync.js +1 -0
- package/lib/Types/index.d.ts +1 -0
- package/lib/Types/index.js +1 -0
- package/lib/Utils/auth-utils.d.ts +1 -0
- package/lib/Utils/auth-utils.js +4 -0
- package/lib/Utils/browser-utils.d.ts +1 -0
- package/lib/Utils/browser-utils.js +3 -2
- package/lib/Utils/business.d.ts +1 -0
- package/lib/Utils/business.js +1 -0
- package/lib/Utils/chat-utils.d.ts +1 -0
- package/lib/Utils/chat-utils.js +1 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +1 -0
- package/lib/Utils/companion-reg-client-utils.js +1 -0
- package/lib/Utils/crypto.d.ts +1 -0
- package/lib/Utils/crypto.js +1 -0
- package/lib/Utils/decode-wa-message.d.ts +1 -0
- package/lib/Utils/decode-wa-message.js +1 -0
- package/lib/Utils/event-buffer.d.ts +1 -0
- package/lib/Utils/event-buffer.js +9 -0
- package/lib/Utils/generics.d.ts +1 -0
- package/lib/Utils/generics.js +2 -1
- package/lib/Utils/history.d.ts +1 -0
- package/lib/Utils/history.js +1 -0
- package/lib/Utils/identity-change-handler.d.ts +1 -0
- package/lib/Utils/identity-change-handler.js +1 -0
- package/lib/Utils/index.d.ts +1 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/link-preview.d.ts +1 -0
- package/lib/Utils/link-preview.js +1 -0
- package/lib/Utils/logger.d.ts +1 -0
- package/lib/Utils/logger.js +1 -0
- package/lib/Utils/lt-hash.d.ts +1 -0
- package/lib/Utils/lt-hash.js +1 -0
- package/lib/Utils/make-mutex.d.ts +1 -0
- package/lib/Utils/make-mutex.js +1 -0
- package/lib/Utils/message-retry-manager.d.ts +1 -0
- package/lib/Utils/message-retry-manager.js +1 -0
- package/lib/Utils/messages-media.d.ts +1 -0
- package/lib/Utils/messages-media.js +28 -92
- package/lib/Utils/messages.d.ts +5 -0
- package/lib/Utils/messages.js +50 -5
- package/lib/Utils/noise-handler.d.ts +1 -0
- package/lib/Utils/noise-handler.js +1 -0
- package/lib/Utils/offline-node-processor.d.ts +2 -0
- package/lib/Utils/offline-node-processor.js +6 -0
- package/lib/Utils/platform-identity.d.ts +1 -0
- package/lib/Utils/platform-identity.js +1 -0
- package/lib/Utils/pre-key-manager.d.ts +1 -0
- package/lib/Utils/pre-key-manager.js +1 -0
- package/lib/Utils/process-message.d.ts +1 -0
- package/lib/Utils/process-message.js +1 -0
- package/lib/Utils/reporting-utils.d.ts +1 -0
- package/lib/Utils/reporting-utils.js +1 -0
- package/lib/Utils/rich-messages.d.ts +1 -0
- package/lib/Utils/rich-messages.js +11 -0
- package/lib/Utils/signal.d.ts +1 -0
- package/lib/Utils/signal.js +1 -0
- package/lib/Utils/stanza-ack.d.ts +1 -0
- package/lib/Utils/stanza-ack.js +1 -0
- package/lib/Utils/sticker-pack.d.ts +1 -0
- package/lib/Utils/sticker-pack.js +1 -0
- package/lib/Utils/sync-action-utils.d.ts +1 -0
- package/lib/Utils/sync-action-utils.js +1 -0
- package/lib/Utils/tc-token-utils.d.ts +1 -0
- package/lib/Utils/tc-token-utils.js +1 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +1 -0
- package/lib/Utils/validate-connection.d.ts +1 -0
- package/lib/Utils/validate-connection.js +1 -0
- package/lib/VoIP/audio-feeder.d.ts +1 -0
- package/lib/VoIP/audio-feeder.js +1 -0
- package/lib/VoIP/index.d.ts +1 -0
- package/lib/VoIP/index.js +1 -0
- package/lib/VoIP/relay-transport.d.ts +1 -0
- package/lib/VoIP/relay-transport.js +1 -0
- package/lib/VoIP/signaling.js +1 -0
- package/lib/VoIP/types.d.ts +1 -0
- package/lib/VoIP/types.js +1 -0
- package/lib/VoIP/wasm-engine.d.ts +1 -0
- package/lib/VoIP/wasm-engine.js +1 -0
- package/lib/VoIP/worker-bootstrap.js +2 -1
- package/lib/WABinary/constants.d.ts +1 -0
- package/lib/WABinary/constants.js +1 -0
- package/lib/WABinary/decode.d.ts +1 -0
- package/lib/WABinary/decode.js +1 -0
- package/lib/WABinary/encode.d.ts +1 -0
- package/lib/WABinary/encode.js +1 -0
- package/lib/WABinary/generic-utils.d.ts +1 -0
- package/lib/WABinary/generic-utils.js +1 -0
- package/lib/WABinary/index.d.ts +1 -0
- package/lib/WABinary/index.js +1 -0
- package/lib/WABinary/jid-utils.d.ts +1 -0
- package/lib/WABinary/jid-utils.js +1 -0
- package/lib/WABinary/types.d.ts +1 -0
- package/lib/WABinary/types.js +1 -0
- package/lib/WAM/BinaryInfo.d.ts +1 -0
- package/lib/WAM/BinaryInfo.js +1 -0
- package/lib/WAM/constants.d.ts +1 -0
- package/lib/WAM/constants.js +1 -0
- package/lib/WAM/encode.d.ts +1 -0
- package/lib/WAM/encode.js +1 -0
- package/lib/WAM/index.d.ts +1 -0
- package/lib/WAM/index.js +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +1 -0
- package/lib/WAUSync/Protocols/index.js +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +1 -0
- package/lib/WAUSync/USyncQuery.js +1 -0
- package/lib/WAUSync/USyncUser.d.ts +1 -0
- package/lib/WAUSync/USyncUser.js +1 -0
- package/lib/WAUSync/index.d.ts +1 -0
- package/lib/WAUSync/index.js +1 -0
- package/lib/assets/wasm/loader.js +1 -0
- package/lib/assets/wasm/worker-modules.js +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/package.json +27 -9
- package/WAProto/GenerateStatics.sh +0 -3
- package/WAProto/fix-imports.js +0 -81
package/assets/logo/README.md
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
# Logo WhatsBibz
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Logo utama (banner/logo lebar 1672×940) diberikan oleh pemilik proyek sebagai WebP
|
|
4
|
+
dan disimpan sebagai `preview.webp`; turunan PNG-nya ada di `preview.png`.
|
|
5
|
+
Keduanya dipakai untuk README dan halaman npm.
|
|
6
6
|
|
|
7
7
|
| Berkas | Pakai untuk |
|
|
8
8
|
|---|---|
|
|
9
|
-
| `preview.
|
|
10
|
-
| `preview
|
|
11
|
-
| `
|
|
12
|
-
| `png/
|
|
13
|
-
| `png/
|
|
9
|
+
| `preview.webp` | master asli (WebP 1672×940) — README, halaman npm |
|
|
10
|
+
| `preview.png` | versi PNG `preview.webp` (1080×607) |
|
|
11
|
+
| `preview-2048.png` | master persegi 2048×2048 dari rebrand sebelumnya (arsip) |
|
|
12
|
+
| `png/logo-1600.png`, `png/logo-800.png` | lockup lama yang dipangkas rapi |
|
|
13
|
+
| `png/mark-1024.png`, `png/mark-512.png` | gelembung saja, latar transparan — avatar, watermark |
|
|
14
|
+
| `png/icon-{16…1024}.png` | ikon persegi sudut membulat — avatar npm/GitHub, app icon |
|
|
14
15
|
| `png/banner-1200x360.png` | banner README/sosial |
|
|
15
16
|
| `whatsbibz.ico` | favicon multi-ukuran 16–256 |
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Regenerasi turunan (mark transparan, ikon, ICO, banner) dari master: skrip yang dipakai ada di
|
|
21
|
-
riwayat proyek (`scripts/` tidak menyertakannya karena hanya dijalankan sekali saat rebrand).
|
|
18
|
+
Ikon, mark, banner, dan favicon masih turunan dari lockup persegi versi lama.
|
|
19
|
+
Setelah versi final disepakati, turunan tersebut perlu diregenerasi dari `preview.webp`.
|
package/assets/logo/preview.png
CHANGED
|
Binary file
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/BibzWhats/banner */
|
|
2
|
+
/**
|
|
3
|
+
* Banner ASCII "WhatsBibz." yang dicetak saat client dibuat.
|
|
4
|
+
* Huruf: "Small Slant" (figlet). Warna: filter pelangi (Rainbow 2).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const BANNER_FONT: string;
|
|
8
|
+
export const BANNER_FILTER: string;
|
|
9
|
+
|
|
10
|
+
/** Banner polos tanpa kode warna ANSI (4 baris, tanpa newline tambahan). */
|
|
11
|
+
export const BANNER_TEXT: string;
|
|
12
|
+
|
|
13
|
+
export interface BannerRenderOptions {
|
|
14
|
+
/** true = selalu berwarna, false = polos, 'auto' (default) = ikuti terminal. */
|
|
15
|
+
color?: boolean | 'auto';
|
|
16
|
+
/** Berapa kali spektrum pelangi diulang sepanjang lebar banner (default 1). */
|
|
17
|
+
cycles?: number;
|
|
18
|
+
/** Environment untuk deteksi warna (default process.env). */
|
|
19
|
+
env?: NodeJS.ProcessEnv;
|
|
20
|
+
/** Stream untuk deteksi TTY (default process.stdout). */
|
|
21
|
+
stream?: unknown;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function colorEnabled(opts?: { env?: NodeJS.ProcessEnv; stream?: unknown }): boolean;
|
|
25
|
+
|
|
26
|
+
/** Render banner menjadi string siap cetak (tanpa newline tambahan). */
|
|
27
|
+
export function renderBanner(options?: BannerRenderOptions): string;
|
|
28
|
+
|
|
29
|
+
/** Cetak banner ke terminal. */
|
|
30
|
+
export function printBanner(
|
|
31
|
+
options?: BannerRenderOptions & { write?: (chunk: string) => void },
|
|
32
|
+
): boolean;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/BibzWhats/banner */
|
|
2
|
+
// BibzWhats — banner ASCII "WhatsBibz." yang dicetak ke terminal saat client dibuat.
|
|
3
|
+
//
|
|
4
|
+
// • Huruf : "Small Slant" (figlet / smslant) — dirender sekali dan disimpan
|
|
5
|
+
// sebagai string statis, jadi TIDAK butuh dependency figlet saat runtime.
|
|
6
|
+
// • Warna : filter pelangi (gradien hue mengalir dari kiri ke kanan), gaya
|
|
7
|
+
// truecolor (24-bit) dengan fallback palet 256 bila terminal tidak
|
|
8
|
+
// mendukungnya, dan otomatis tanpa warna (plain) bila stdout bukan TTY.
|
|
9
|
+
// • Matikan : NO_COLOR=1, atau opsi client `banner: false`.
|
|
10
|
+
|
|
11
|
+
// Baris asli hasil figlet.textSync('WhatsBibz.', { font: 'Small Slant' }).
|
|
12
|
+
// Perhatikan: sebagian besar glyph saling berimpit karena font-nya miring rapat —
|
|
13
|
+
// itu memang karakteristik "Small Slant".
|
|
14
|
+
const LINES = [
|
|
15
|
+
" _ ____ __ ___ _ __ ",
|
|
16
|
+
" | | /| / / / ___ _/ /____ / _ )(_) / ___ ",
|
|
17
|
+
" | |/ |/ / _ \\/ _ `/ __(_-</ _ / / _ \\/_ /_ ",
|
|
18
|
+
" |__/|__/_//_/\\_,_/\\__/___/____/_/_.__//__(_)",
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export const BANNER_FONT = 'Small Slant';
|
|
22
|
+
export const BANNER_FILTER = 'Rainbow 2';
|
|
23
|
+
|
|
24
|
+
const MAX_WIDTH = Math.max(...LINES.map((l) => l.length));
|
|
25
|
+
|
|
26
|
+
/** Banner polos (tanpa ANSI) — 4 baris, tanpa baris kosong di ujung. */
|
|
27
|
+
export const BANNER_TEXT = LINES.map((l) => l.trimEnd()).join('\n');
|
|
28
|
+
|
|
29
|
+
const RESET = '\x1b[0m';
|
|
30
|
+
const TRUE_COLOR_TERMS = new Set(['truecolor', '24bit']);
|
|
31
|
+
const TRUECOLOR_TERM_PROGRAMS = ['iterm.app', 'wezterm', 'vscode', 'hyper', 'tabby', 'ghostty', 'kitty', 'alacritty'];
|
|
32
|
+
|
|
33
|
+
/** Deteksi warna: hormati NO_COLOR / FORCE_COLOR; default hanya saat stdout TTY. */
|
|
34
|
+
export function colorEnabled({ env = process.env, stream = process.stdout } = {}) {
|
|
35
|
+
const nc = env.NO_COLOR;
|
|
36
|
+
if (nc !== undefined && nc !== '' && nc !== '0') return false;
|
|
37
|
+
const fc = env.FORCE_COLOR;
|
|
38
|
+
if (fc !== undefined && fc !== '' && fc !== '0') return true;
|
|
39
|
+
return !!(stream && stream.isTTY) && env.TERM !== 'dumb';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function trueColorSupported(env = process.env) {
|
|
43
|
+
const ct = String(env.COLORTERM || '').toLowerCase();
|
|
44
|
+
if (ct && TRUE_COLOR_TERMS.has(ct)) return true;
|
|
45
|
+
const prog = String(env.TERM_PROGRAM || '').toLowerCase();
|
|
46
|
+
return TRUECOLOR_TERM_PROGRAMS.some((p) => prog.includes(p));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function hslToRgb(h, s, l) {
|
|
50
|
+
h = ((h % 360) + 360) % 360;
|
|
51
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
52
|
+
const hp = h / 60;
|
|
53
|
+
const x = c * (1 - Math.abs((hp % 2) - 1));
|
|
54
|
+
let r = 0, g = 0, b = 0;
|
|
55
|
+
if (hp < 1) [r, g, b] = [c, x, 0];
|
|
56
|
+
else if (hp < 2) [r, g, b] = [x, c, 0];
|
|
57
|
+
else if (hp < 3) [r, g, b] = [0, c, x];
|
|
58
|
+
else if (hp < 4) [r, g, b] = [0, x, c];
|
|
59
|
+
else if (hp < 5) [r, g, b] = [x, 0, c];
|
|
60
|
+
else [r, g, b] = [c, 0, x];
|
|
61
|
+
const m = l - c / 2;
|
|
62
|
+
return [Math.round((r + m) * 255), Math.round((g + m) * 255), Math.round((b + m) * 255)];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Pendekatan terdekat ke kode palet 256 (cube 6×6×6 atau grayscale).
|
|
66
|
+
const CUBE = [0, 95, 135, 175, 215, 255];
|
|
67
|
+
function nearest256(r, g, b) {
|
|
68
|
+
const map = (v) => CUBE.reduce((best, x) => (Math.abs(x - v) < Math.abs(best - v) ? x : best), CUBE[0]);
|
|
69
|
+
const rr = map(r), gg = map(g), bb = map(b);
|
|
70
|
+
const rgbErr = (rr - r) ** 2 + (gg - g) ** 2 + (bb - b) ** 2;
|
|
71
|
+
const avg = (r + g + b) / 3;
|
|
72
|
+
const grayIdx = Math.min(23, Math.max(0, Math.round((avg - 3) / 10)));
|
|
73
|
+
const grayV = 8 + grayIdx * 10;
|
|
74
|
+
const grayErr = (grayV - r) ** 2 + (grayV - g) ** 2 + (grayV - b) ** 2;
|
|
75
|
+
if (grayErr < rgbErr) return `38;5;${232 + grayIdx}`;
|
|
76
|
+
return `38;5;${16 + 36 * CUBE.indexOf(rr) + 6 * CUBE.indexOf(gg) + CUBE.indexOf(bb)}`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function colorCode(r, g, b, trueColor) {
|
|
80
|
+
return trueColor ? `38;2;${r};${g};${b}` : nearest256(r, g, b);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Render banner.
|
|
85
|
+
* @param {object} [opts]
|
|
86
|
+
* @param {boolean|'auto'} [opts.color='auto'] true=selalu berwarna, false=polos, 'auto'=ikuti terminal
|
|
87
|
+
* @param {number} [opts.cycles=1] berapa kali spektrum pelangi diulang sepanjang lebar banner
|
|
88
|
+
* @param {object} [opts.env] environment (untuk deteksi warna)
|
|
89
|
+
* @param {object} [opts.stream] stream untuk deteksi TTY (biasanya process.stdout)
|
|
90
|
+
* @returns {string} banner siap dicetak (tanpa newline tambahan)
|
|
91
|
+
*/
|
|
92
|
+
export function renderBanner({ color = 'auto', cycles = 1, env = process.env, stream = process.stdout } = {}) {
|
|
93
|
+
const useColor = color === true || (color === 'auto' && colorEnabled({ env, stream }));
|
|
94
|
+
if (!useColor) return BANNER_TEXT;
|
|
95
|
+
const trueColor = trueColorSupported(env);
|
|
96
|
+
return LINES.map((line) => {
|
|
97
|
+
let out = '';
|
|
98
|
+
for (let c = 0; c < line.length; c++) {
|
|
99
|
+
const ch = line[c];
|
|
100
|
+
if (ch === ' ') {
|
|
101
|
+
out += ' ';
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
const hue = ((c / MAX_WIDTH) * 360 * cycles) % 360;
|
|
105
|
+
const [r, g, b] = hslToRgb(hue, 1, 0.5);
|
|
106
|
+
out += `\x1b[${colorCode(r, g, b, trueColor)}m${ch}${RESET}`;
|
|
107
|
+
}
|
|
108
|
+
return out.trimEnd();
|
|
109
|
+
}).join('\n');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Cetak banner ke terminal.
|
|
114
|
+
* @param {object} [opts] meneruskan opsi renderBanner + `write`
|
|
115
|
+
* @param {(s:string)=>void} [opts.write] penulis output (default process.stdout.write)
|
|
116
|
+
*/
|
|
117
|
+
export function printBanner(opts = {}) {
|
|
118
|
+
const { write = (s) => process.stdout.write(s), ...rest } = opts;
|
|
119
|
+
write(renderBanner(rest) + '\n');
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/BibzWhats/client */
|
|
1
2
|
import { EventEmitter } from 'events';
|
|
2
3
|
import type { WASocket } from '../index.js';
|
|
3
4
|
import type { SocketConfig, WABrowserDescription, ConnectionState } from '../Types/index.js';
|
|
@@ -33,6 +34,12 @@ export interface BibzWhatsOptions {
|
|
|
33
34
|
logger?: BibzWhatsLogger;
|
|
34
35
|
/** cetak QR ASCII ke console saat fallback (butuh qrcode-terminal) */
|
|
35
36
|
printQR?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Cetak banner ASCII "WhatsBibz." saat client dibuat.
|
|
39
|
+
* Default (undefined): hanya di terminal interaktif (stdout TTY).
|
|
40
|
+
* true = selalu cetak, false = jangan pernah.
|
|
41
|
+
*/
|
|
42
|
+
banner?: boolean;
|
|
36
43
|
/** opsi tambahan langsung ke makeWASocket (override) */
|
|
37
44
|
socketConfig?: Partial<SocketConfig>;
|
|
38
45
|
maxReconnectAttempts?: number;
|
|
@@ -55,7 +62,7 @@ export interface BibzWhatsOptions {
|
|
|
55
62
|
/** default true: 'ready' dipancarkan untuk setiap socket baru (pertama & tiap reconnect) */
|
|
56
63
|
readyOnEveryConnect?: boolean;
|
|
57
64
|
}
|
|
58
|
-
export declare const BIBZWHATS_DEFAULTS: Readonly<Required<Omit<BibzWhatsOptions, 'phone' | 'pairingCode' | 'logger' | 'printQR' | 'socketConfig'>>>;
|
|
65
|
+
export declare const BIBZWHATS_DEFAULTS: Readonly<Required<Omit<BibzWhatsOptions, 'phone' | 'pairingCode' | 'logger' | 'printQR' | 'socketConfig' | 'banner'>>>;
|
|
59
66
|
export declare function wipeAuthDir(dir: string): boolean;
|
|
60
67
|
export declare function makeSocketNetworkOptions(opts?: { forceIPv4?: boolean }): Partial<SocketConfig>;
|
|
61
68
|
export declare function sessionWipeReason(status: number | undefined, message?: string): string | null;
|
package/lib/BibzWhats/client.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/BibzWhats/client */
|
|
1
2
|
// BibzWhats — createBibzWhats()
|
|
2
3
|
// Pembungkus tingkat tinggi di atas makeWASocket:
|
|
3
4
|
// • versi WA Web TERBARU diambil di setiap connect (server menolak versi lama)
|
|
@@ -24,6 +25,7 @@ import { Browsers } from '../Utils/browser-utils.js';
|
|
|
24
25
|
import { lintIdentity, derivePairingDisplay } from '../Utils/platform-identity.js';
|
|
25
26
|
import { resolveDeviceIdentity, createIdentityRotator, isIdentityRejection, describeIdentity, clearIdentityState, loadIdentityState, saveIdentityState } from './device-identity.js';
|
|
26
27
|
import { createPairingController } from './pairing.js';
|
|
28
|
+
import { printBanner } from './banner.js';
|
|
27
29
|
|
|
28
30
|
export const BIBZWHATS_DEFAULTS = Object.freeze({
|
|
29
31
|
authDir: 'bibzwhats-session',
|
|
@@ -106,6 +108,9 @@ function mergeLogger(logger) {
|
|
|
106
108
|
* @property {[string,string,string]} [browser] alias lama `identity` (tuple eksplisit)
|
|
107
109
|
* @property {object} [logger] {info,warn,error,ok,debug}
|
|
108
110
|
* @property {boolean} [printQR] cetak QR ASCII ke console saat fallback (butuh qrcode-terminal)
|
|
111
|
+
* @property {boolean} [banner] cetak banner ASCII 'WhatsBibz.' saat client dibuat.
|
|
112
|
+
* default: hanya di terminal interaktif (stdout TTY);
|
|
113
|
+
* true = selalu, false = jangan pernah.
|
|
109
114
|
* @property {object} [socketConfig] opsi tambahan langsung ke makeWASocket (override)
|
|
110
115
|
* @property {string} [companionPlatformDisplay] override `companion_platform_display` (WA memvalidasi dgn allow-list; default diturunkan otomatis, mis. "Chrome (Mac OS)" / "Chrome (Linux)")
|
|
111
116
|
* @property {boolean} [readyOnEveryConnect] default true — 'ready' tiap socket baru; false = hanya sekali
|
|
@@ -127,6 +132,14 @@ export async function createBibzWhats(options = {}) {
|
|
|
127
132
|
const emitter = new EventEmitter();
|
|
128
133
|
const groupMetadataCache = new Map();
|
|
129
134
|
|
|
135
|
+
// Banner ASCII 'WhatsBibz.' (Small Slant, pelangi) — hanya terminal interaktif secara
|
|
136
|
+
// bawaan; `banner: true` memaksa cetak (mis. untuk log/daemon), `banner: false` mematikan.
|
|
137
|
+
const wantBanner =
|
|
138
|
+
opts.banner === true || (opts.banner !== false && !!process.stdout.isTTY);
|
|
139
|
+
if (wantBanner) {
|
|
140
|
+
try { printBanner(); } catch {}
|
|
141
|
+
}
|
|
142
|
+
|
|
130
143
|
// ── Identitas perangkat tertaut: kustom (opsi/env) atau otomatis (paling stabil) ──
|
|
131
144
|
const resolved = resolveDeviceIdentity({ identity: opts.identity === 'auto' ? undefined : opts.identity, browser: opts.browser, authDir: opts.authDir });
|
|
132
145
|
for (const note of resolved.notes) (note.level === 'warn' ? log.warn : log.info)(`BibzWhats: ${note.message}`);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/BibzWhats/extract */
|
|
1
2
|
import type { WAMessage, proto } from '../index.js';
|
|
2
3
|
export type ExtractedType = 'text' | 'image' | 'video' | 'audio' | 'sticker' | 'document' | 'reaction' | 'button' | 'poll' | 'other';
|
|
3
4
|
export interface ExtractedMessage {
|
package/lib/BibzWhats/extract.js
CHANGED
package/lib/BibzWhats/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/BibzWhats/index */
|
|
1
2
|
export * from './pairing.js';
|
|
2
3
|
export * from './client.js';
|
|
3
4
|
export * from './device-identity.js';
|
|
4
5
|
export * from './send.js';
|
|
5
6
|
export * from './extract.js';
|
|
6
7
|
export * from './jid.js';
|
|
8
|
+
export * from './banner.js';
|
|
7
9
|
export { BIBZWHATS_VERSION, BIBZWHATS_NAME, BIBZWHATS_PACKAGE, BIBZWHATS_UPSTREAM, BIBZWHATS_WA_WEB_VERSION } from './version.js';
|
package/lib/BibzWhats/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/BibzWhats/index */
|
|
1
2
|
// BibzWhats — lapisan API tingkat tinggi.
|
|
2
3
|
export * from './pairing.js';
|
|
3
4
|
export * from './client.js';
|
|
@@ -5,4 +6,5 @@ export * from './device-identity.js';
|
|
|
5
6
|
export * from './send.js';
|
|
6
7
|
export * from './extract.js';
|
|
7
8
|
export * from './jid.js';
|
|
9
|
+
export * from './banner.js';
|
|
8
10
|
export { BIBZWHATS_VERSION, BIBZWHATS_NAME, BIBZWHATS_PACKAGE, BIBZWHATS_UPSTREAM, BIBZWHATS_WA_WEB_VERSION } from './version.js';
|
package/lib/BibzWhats/jid.d.ts
CHANGED
package/lib/BibzWhats/jid.js
CHANGED
package/lib/BibzWhats/pairing.js
CHANGED
package/lib/BibzWhats/send.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/BibzWhats/send */
|
|
1
2
|
import type { WASocket } from '../index.js';
|
|
2
3
|
import type { AnyMessageContent, WAMessage, WAMessageKey, WAPresence } from '../Types/index.js';
|
|
3
4
|
export declare function splitText(text: string, maxLen?: number): string[];
|
package/lib/BibzWhats/send.js
CHANGED
package/lib/BibzWhats/version.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export const BIBZWHATS_NAME = 'WhatsBibz';
|
|
2
2
|
/** nama paket di npm */
|
|
3
3
|
export const BIBZWHATS_PACKAGE = '@xbibzlibrary/whatsbibz';
|
|
4
|
-
export const BIBZWHATS_VERSION = '1.3
|
|
5
|
-
export const BIBZWHATS_UPSTREAM = '
|
|
6
|
-
/** versi WA Web bawaan (fallback) — diperbarui 2026-
|
|
7
|
-
export const BIBZWHATS_WA_WEB_VERSION = [2, 3000,
|
|
4
|
+
export const BIBZWHATS_VERSION = '1.4.3';
|
|
5
|
+
export const BIBZWHATS_UPSTREAM = 'WhiskeySockets/Baileys v7 + patch upstream s/d 2026-10 (rc14/master & PR #2769/#2776/#2778/#2789/#2804/#2807/#2808/#2834-#2840/#2856/#2864-#2866); identitas platform diukur ke server 2026-10-21';
|
|
6
|
+
/** versi WA Web bawaan (fallback) — diperbarui 2026-10-21 dari web.whatsapp.com */
|
|
7
|
+
export const BIBZWHATS_WA_WEB_VERSION = [2, 3000, 1051141409];
|
|
8
|
+
|
package/lib/Defaults/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Defaults/index */
|
|
1
2
|
import { proto } from '../../WAProto/index.js';
|
|
2
3
|
import type { SocketConfig } from '../Types/index.js';
|
|
3
4
|
export declare const UNAUTHORIZED_CODES: number[];
|
|
@@ -55,6 +56,8 @@ export declare const MEDIA_HKDF_KEY_MAPPING: {
|
|
|
55
56
|
};
|
|
56
57
|
export type MediaType = keyof typeof MEDIA_HKDF_KEY_MAPPING;
|
|
57
58
|
export declare const MEDIA_KEYS: MediaType[];
|
|
59
|
+
/** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
|
|
60
|
+
export declare const HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
|
|
58
61
|
export declare const MIN_PREKEY_COUNT = 5;
|
|
59
62
|
export declare const INITIAL_PREKEY_COUNT = 812;
|
|
60
63
|
export declare const UPLOAD_TIMEOUT = 30000;
|
package/lib/Defaults/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Defaults/index */
|
|
1
2
|
import { proto } from "../../WAProto/index.js";
|
|
2
3
|
import { makeLibSignalRepository } from "../Signal/libsignal.js";
|
|
3
4
|
import { Browsers } from "../Utils/browser-utils.js";
|
|
4
5
|
import logger from "../Utils/logger.js";
|
|
5
|
-
const version = [2, 3000,
|
|
6
|
+
const version = [2, 3000, 1051141409];
|
|
6
7
|
export const UNAUTHORIZED_CODES = [401, 403, 419];
|
|
7
8
|
export const DEFAULT_ORIGIN = "https://web.whatsapp.com";
|
|
8
9
|
export const CALL_VIDEO_PREFIX = "https://call.whatsapp.com/video/";
|
|
@@ -75,11 +76,6 @@ export const DEFAULT_CONNECTION_CONFIG = {
|
|
|
75
76
|
snapshot: false,
|
|
76
77
|
},
|
|
77
78
|
countryCode: "US",
|
|
78
|
-
// BibzWhats: tidak ada auto-follow channel diam-diam. Set true + isi
|
|
79
|
-
// autoFollowNewsletterJid bila memang ingin memakainya.
|
|
80
|
-
autoFollowNewsletterOnConnect: false,
|
|
81
|
-
autoFollowNewsletterDelayMs: 90000,
|
|
82
|
-
autoFollowNewsletterJid: "",
|
|
83
79
|
getMessage: async () => undefined,
|
|
84
80
|
cachedGroupMetadata: async () => undefined,
|
|
85
81
|
makeSignalRepository: makeLibSignalRepository,
|
|
@@ -123,6 +119,8 @@ export const MEDIA_HKDF_KEY_MAPPING = {
|
|
|
123
119
|
"sticker-pack": "Sticker Pack",
|
|
124
120
|
};
|
|
125
121
|
export const MEDIA_KEYS = Object.keys(MEDIA_PATH_MAP);
|
|
122
|
+
/** 120s timeout for history sync stall detection, same as WA Web's handleChunkProgress / restartPausedTimer (g = 120) */
|
|
123
|
+
export const HISTORY_SYNC_PAUSED_TIMEOUT_MS = 120000;
|
|
126
124
|
export const MIN_PREKEY_COUNT = 5;
|
|
127
125
|
export const INITIAL_PREKEY_COUNT = 812;
|
|
128
126
|
export const UPLOAD_TIMEOUT = 30000; // 30 seconds
|
|
@@ -1,32 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Built for creating buttons, carousels, native flows,
|
|
6
|
-
* and AI rich response payloads using BibzWhats with
|
|
7
|
-
* fluent chaining, flexible payload customization,
|
|
8
|
-
* and scalable architecture for modern bot development.
|
|
9
|
-
*
|
|
10
|
-
* Runtime:
|
|
11
|
-
* - BibzWhats (fork Baileys)
|
|
12
|
-
*
|
|
13
|
-
* Created by Nixel
|
|
14
|
-
* Contributors: ~ Ahmad tumbuh kembang
|
|
15
|
-
*
|
|
16
|
-
* WhatsApp: wa.me/6285188349341
|
|
17
|
-
* Channel: https://whatsapp.com/channel/0029VbCV1ck8fewpdNb2TY2k
|
|
18
|
-
*
|
|
19
|
-
* Copyright (c) 2026 Nixel
|
|
20
|
-
*
|
|
21
|
-
* Permission is granted to use and modify this library
|
|
22
|
-
* for personal or commercial projects.
|
|
23
|
-
*
|
|
24
|
-
* Reuploading, reselling, relicensing, or redistributing
|
|
25
|
-
* this library as a standalone product is prohibited.
|
|
26
|
-
*
|
|
27
|
-
* Do not claim this project as your own original work.
|
|
2
|
+
* @module @xbibzlibrary/whatsbibz/Modded/message_builder
|
|
3
|
+
* BibzWhats Interactive Message Builder
|
|
4
|
+
* Supports buttons, carousels, native flows, and AI rich response payloads.
|
|
28
5
|
*/
|
|
29
|
-
|
|
30
6
|
'use strict';
|
|
31
7
|
|
|
32
8
|
const VERSION = '4.6';
|
|
@@ -145,7 +121,7 @@ function extractIE(text, { extract = true, hyperlink = true, citation = true, la
|
|
|
145
121
|
|
|
146
122
|
let [txt = '', width = null, height = null, font_height = null, padding = null] = raw.split('|');
|
|
147
123
|
|
|
148
|
-
key =
|
|
124
|
+
key = `BIBZWHATS_LATEX_${latex_index++}`;
|
|
149
125
|
tag = `{{${key}}}${txt || 'image'}{{/${key}}}`;
|
|
150
126
|
|
|
151
127
|
data = {
|
|
@@ -169,7 +145,7 @@ function extractIE(text, { extract = true, hyperlink = true, citation = true, la
|
|
|
169
145
|
url = url.slice(1);
|
|
170
146
|
}
|
|
171
147
|
|
|
172
|
-
key =
|
|
148
|
+
key = `BIBZWHATS_HYPERLINK_${hyperlink_index++}`;
|
|
173
149
|
tag = `{{${key}}}${url}{{/${key}}}`;
|
|
174
150
|
|
|
175
151
|
data = {
|
|
@@ -184,7 +160,7 @@ function extractIE(text, { extract = true, hyperlink = true, citation = true, la
|
|
|
184
160
|
} else {
|
|
185
161
|
if (!citation) continue;
|
|
186
162
|
|
|
187
|
-
key =
|
|
163
|
+
key = `BIBZWHATS_CITATION_${citation_index - 1}`;
|
|
188
164
|
tag = `{{${key}}}${url}{{/${key}}}`;
|
|
189
165
|
|
|
190
166
|
data = {
|
|
@@ -281,7 +257,7 @@ class Toolkit {
|
|
|
281
257
|
},
|
|
282
258
|
{
|
|
283
259
|
upload: _client.waUploadToServer,
|
|
284
|
-
jid: '
|
|
260
|
+
jid: '@newsletter',
|
|
285
261
|
}
|
|
286
262
|
);
|
|
287
263
|
|
|
@@ -813,18 +789,15 @@ class Button extends BaseBuilder {
|
|
|
813
789
|
}
|
|
814
790
|
|
|
815
791
|
async build(jid, { ...options } = {}) {
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
}
|
|
820
|
-
this._cardBuilders = [];
|
|
821
|
-
}
|
|
792
|
+
// Konten interactive message = hasil toCard() (body/footer/header + nativeFlowMessage).
|
|
793
|
+
// Sebelumnya memakai variabel `message` yang tidak pernah didefinisikan → ReferenceError.
|
|
794
|
+
const payload = await this.toCard();
|
|
822
795
|
return generateWAMessageFromContent(
|
|
823
796
|
jid,
|
|
824
797
|
{
|
|
825
798
|
...this._extraPayload,
|
|
826
799
|
interactiveMessage: {
|
|
827
|
-
...
|
|
800
|
+
...payload,
|
|
828
801
|
contextInfo: this._contextInfo,
|
|
829
802
|
},
|
|
830
803
|
},
|
|
@@ -833,6 +806,7 @@ class Button extends BaseBuilder {
|
|
|
833
806
|
}
|
|
834
807
|
|
|
835
808
|
async send(jid, { ...options } = {}) {
|
|
809
|
+
if (this._buttons.length < 1) throw new Error('Button requires at least one button');
|
|
836
810
|
const msg = await this.build(jid, options);
|
|
837
811
|
|
|
838
812
|
await this.#client.relayMessage(msg.key.remoteJid, msg.message, {
|
|
@@ -997,7 +971,17 @@ class Carousel extends BaseBuilder {
|
|
|
997
971
|
return this;
|
|
998
972
|
}
|
|
999
973
|
|
|
1000
|
-
build(jid, { ...options } = {}) {
|
|
974
|
+
async build(jid, { ...options } = {}) {
|
|
975
|
+
// Konsumsi builder terdaftar lewat .card(cb). Sebelumnya _cardBuilders tidak pernah
|
|
976
|
+
// dipakai di sini → carousel terkirim dengan 0 kartu (diam-diam rusak).
|
|
977
|
+
if (this._cardBuilders && this._cardBuilders.length > 0) {
|
|
978
|
+
const built = [];
|
|
979
|
+
for (const builder of this._cardBuilders) {
|
|
980
|
+
built.push(await builder._card.toCard());
|
|
981
|
+
}
|
|
982
|
+
this._cardBuilders = [];
|
|
983
|
+
this.addCard(built);
|
|
984
|
+
}
|
|
1001
985
|
return generateWAMessageFromContent(
|
|
1002
986
|
jid,
|
|
1003
987
|
{
|
|
@@ -1019,6 +1003,15 @@ class Carousel extends BaseBuilder {
|
|
|
1019
1003
|
}
|
|
1020
1004
|
|
|
1021
1005
|
async send(jid, { ...options } = {}) {
|
|
1006
|
+
if (this._cardBuilders && this._cardBuilders.length > 0) {
|
|
1007
|
+
const built = [];
|
|
1008
|
+
for (const builder of this._cardBuilders) {
|
|
1009
|
+
built.push(await builder._card.toCard());
|
|
1010
|
+
}
|
|
1011
|
+
this._cardBuilders = [];
|
|
1012
|
+
this.addCard(built);
|
|
1013
|
+
}
|
|
1014
|
+
if (this._cards.length < 1) throw new Error('Carousel requires at least one card');
|
|
1022
1015
|
const msg = await this.build(jid, options);
|
|
1023
1016
|
|
|
1024
1017
|
await this.#client.relayMessage(msg.key.remoteJid, msg.message, {
|
|
@@ -1243,7 +1236,7 @@ class AIRich extends BaseBuilder {
|
|
|
1243
1236
|
|
|
1244
1237
|
reels.forEach((item, idx) => {
|
|
1245
1238
|
this._richResponseSources.push({
|
|
1246
|
-
provider: '
|
|
1239
|
+
provider: 'BIBZWHATS',
|
|
1247
1240
|
thumbnailCDNURL: item._thumbnail,
|
|
1248
1241
|
sourceProviderURL: item.videoUrl ?? item.url ?? '',
|
|
1249
1242
|
sourceQuery: '',
|
|
@@ -1344,7 +1337,7 @@ class AIRich extends BaseBuilder {
|
|
|
1344
1337
|
|
|
1345
1338
|
this._submessages.push({
|
|
1346
1339
|
messageType: 2,
|
|
1347
|
-
messageText: '[ CANNOT_LOAD_VIDEO
|
|
1340
|
+
messageText: '[ CANNOT_LOAD_VIDEO ]',
|
|
1348
1341
|
});
|
|
1349
1342
|
|
|
1350
1343
|
items.forEach((item) => {
|
|
@@ -1414,7 +1407,7 @@ class AIRich extends BaseBuilder {
|
|
|
1414
1407
|
|
|
1415
1408
|
this._submessages.push({
|
|
1416
1409
|
messageType: 2,
|
|
1417
|
-
messageText: '[ CANNOT_LOAD_PRODUCT
|
|
1410
|
+
messageText: '[ CANNOT_LOAD_PRODUCT ]',
|
|
1418
1411
|
});
|
|
1419
1412
|
|
|
1420
1413
|
const items = Array.isArray(data) ? data : [data];
|
|
@@ -1450,7 +1443,7 @@ class AIRich extends BaseBuilder {
|
|
|
1450
1443
|
|
|
1451
1444
|
this._submessages.push({
|
|
1452
1445
|
messageType: 2,
|
|
1453
|
-
messageText: '[ CANNOT_LOAD_POST
|
|
1446
|
+
messageText: '[ CANNOT_LOAD_POST ]',
|
|
1454
1447
|
});
|
|
1455
1448
|
|
|
1456
1449
|
const primitives = posts.map((p) => ({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Signal/Group/group-session-builder */
|
|
1
2
|
import { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
|
|
2
3
|
import { SenderKeyName } from './sender-key-name.js';
|
|
3
4
|
import { SenderKeyRecord } from './sender-key-record.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Signal/Group/index */
|
|
1
2
|
export { GroupSessionBuilder } from './group-session-builder.js';
|
|
2
3
|
export { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
|
|
3
4
|
export { SenderKeyRecord } from './sender-key-record.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Signal/Group/index */
|
|
1
2
|
export { GroupSessionBuilder } from './group-session-builder.js';
|
|
2
3
|
export { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
|
|
3
4
|
export { SenderKeyRecord } from './sender-key-record.js';
|