@vanzxy/baileys 1.2.5 β 1.2.7
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 +155 -41
- package/lib/Defaults/index.js +10 -3
- package/lib/Socket/dugong.js +774 -0
- package/lib/Socket/groups.js +22 -15
- package/lib/Socket/index.js +6 -3
- package/lib/Socket/messages-recv.js +28 -18
- package/lib/Socket/messages-send.js +18 -4
- package/lib/Socket/newsletter.js +96 -1
- package/lib/Socket/socket.js +36 -2
- package/lib/Store/make-in-memory-store.js +10 -2
- package/lib/Utils/crypto.js +31 -1
- package/lib/Utils/decode-wa-message.js +3 -1
- package/lib/Utils/event-buffer.js +17 -3
- package/lib/Utils/generics.js +1 -1
- package/lib/Utils/history.js +13 -0
- package/lib/Utils/messages-media.js +48 -22
- package/lib/Utils/messages.js +37 -6
- package/lib/Utils/process-message.js +49 -40
- package/lib/Utils/rich-message-utils.js +38 -3
- package/lib/Utils/use-sqlite-auth-state.js +22 -0
- package/lib/Utils/validate-connection.js +2 -2
- package/lib/WABinary/generic-utils.js +34 -5
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +13 -4
- package/lib/WAUSync/Protocols/index.js +2 -0
- package/lib/WAUSync/USyncQuery.js +26 -2
- package/lib/index.js +2 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,61 +1,175 @@
|
|
|
1
|
-
#
|
|
1
|
+
# π @vanzxy/baileys
|
|
2
|
+
|
|
3
|
+
> Next-generation Baileys fork by **Vanzxy**.
|
|
4
|
+
> Built for modern WhatsApp bot development with extended interactive messages, native flow enhancements, status tools, and quality-of-life improvements.
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# β¨ Why @vanzxy/baileys?
|
|
13
|
+
|
|
14
|
+
This fork focuses on:
|
|
15
|
+
|
|
16
|
+
- π Better developer experience
|
|
17
|
+
- π― Extended native flow support
|
|
18
|
+
- π’ Advanced status & broadcast features
|
|
19
|
+
- π§© More interactive message types
|
|
20
|
+
- β‘ Cleaner implementation for bot developers
|
|
21
|
+
- π§ Extra utilities not available in standard Baileys forks
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# π₯ Features
|
|
26
|
+
|
|
27
|
+
## Interactive Messages
|
|
28
|
+
- Native Flow
|
|
29
|
+
- Buttons
|
|
30
|
+
- Lists
|
|
31
|
+
- Carousel Messages
|
|
32
|
+
- Rich Response Messages
|
|
33
|
+
- CTA Buttons
|
|
34
|
+
- Reply Buttons
|
|
35
|
+
- URL Buttons
|
|
36
|
+
- Call Buttons
|
|
37
|
+
- OTP Buttons
|
|
38
|
+
- Authentication Buttons
|
|
39
|
+
|
|
40
|
+
## Commerce & Business
|
|
41
|
+
- Catalog Message
|
|
42
|
+
- Order Details
|
|
43
|
+
- Order Status
|
|
44
|
+
- Review & Pay
|
|
45
|
+
- Payment Status
|
|
46
|
+
- Payment Method
|
|
47
|
+
- Track Order
|
|
48
|
+
- Reorder
|
|
49
|
+
- Cancel Order
|
|
50
|
+
|
|
51
|
+
## Utility Features
|
|
52
|
+
- Group Status Support
|
|
53
|
+
- Mention All
|
|
54
|
+
- Lottie Sticker Support
|
|
55
|
+
- Newsletter Support
|
|
56
|
+
- ExternalAdReply Helper
|
|
57
|
+
- View Once Support
|
|
58
|
+
- Rich Formatting
|
|
59
|
+
- Code Highlighting
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
# π Exclusive Vanzxy Enhancements
|
|
64
|
+
|
|
65
|
+
### Audio Group Status Fix
|
|
66
|
+
Audio status uses a more compatible implementation to avoid unsupported-version errors on older WhatsApp clients.
|
|
67
|
+
|
|
68
|
+
### Native Flow Expansion
|
|
69
|
+
Additional supported button types:
|
|
70
|
+
|
|
71
|
+
- cta_reminder
|
|
72
|
+
- cta_cancel_reminder
|
|
73
|
+
- address_message
|
|
74
|
+
- send_location
|
|
75
|
+
- catalog_message
|
|
76
|
+
- mpm
|
|
77
|
+
- otp_button
|
|
78
|
+
- authentication_button
|
|
79
|
+
- call_button
|
|
80
|
+
- url_button
|
|
81
|
+
- reply_button
|
|
82
|
+
- card_message
|
|
83
|
+
- order_details
|
|
84
|
+
- order_status
|
|
85
|
+
- review_and_pay
|
|
86
|
+
- payment_status
|
|
87
|
+
- payment_method
|
|
88
|
+
- track_order
|
|
89
|
+
- reorder
|
|
90
|
+
- cancel_order
|
|
91
|
+
- clear_chat
|
|
92
|
+
- navigateToScreen
|
|
93
|
+
- flow_action
|
|
94
|
+
- voice_call
|
|
95
|
+
- video_call_button
|
|
96
|
+
|
|
97
|
+
### System Notification Filter
|
|
98
|
+
Messages include:
|
|
2
99
|
|
|
3
|
-
|
|
100
|
+
```js
|
|
101
|
+
message.isSystemNotification
|
|
102
|
+
```
|
|
4
103
|
|
|
5
|
-
|
|
104
|
+
Useful for filtering:
|
|
6
105
|
|
|
7
|
-
|
|
106
|
+
- E2E notices
|
|
107
|
+
- Meta service notices
|
|
108
|
+
- Other system-generated messages
|
|
8
109
|
|
|
9
|
-
|
|
10
|
-
- **No "Lihat Saluran" Button** β Removed `mediaAnnotation` that auto-injected newsletter context into every image/video upload, causing an unwanted *"Lihat saluran"* button to appear on all media messages.
|
|
11
|
-
- **Extended Native Flow Buttons** β Added support for `cta_reminder`, `cta_cancel_reminder`, `address_message`, `send_location`, `catalog_message`, `mpm`, `otp_button`, `authentication_button`, `call_button`, `url_button`, `reply_button`, `card_message`, `order_details`, `order_status`, `review_and_pay`, `payment_status`, `payment_method`, `track_order`, `reorder`, `cancel_order`, `clear_chat`, `navigateToScreen`, `flow_action`, `voice_call`, `video_call_button` β fully additive, existing button types untouched.
|
|
12
|
-
- **System Notification Filtering** β Messages now carry an `isSystemNotification` flag (e.g. for E2E encryption notices, "business uses Meta service" notices) so bots can easily skip them without affecting normal message handling.
|
|
110
|
+
---
|
|
13
111
|
|
|
14
|
-
|
|
15
|
-
- Interactive messages (buttons, list, native flow, carousel)
|
|
16
|
-
- Album message (multi image/video)
|
|
17
|
-
- Group Status message (`groupStatus: true`)
|
|
18
|
-
- `mentionAll` without listing JIDs
|
|
19
|
-
- `makeInMemoryStore` ESM port
|
|
20
|
-
- Rich response, code blocks, tables, inline entities
|
|
21
|
-
- Sticker pack, lottie sticker, spoiler, view once v2
|
|
22
|
-
- Newsletter fixes, `externalAdReply` helper
|
|
23
|
-
- `findUserId` for JID/LID lookup
|
|
24
|
-
- `tokenizeCode` for syntax highlighting
|
|
112
|
+
# π¦ Installation
|
|
25
113
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- New chat message cap
|
|
30
|
-
- `validateSession` checks
|
|
31
|
-
- `fetchNewChatMessageCap`, `fetchAccountReachoutTimelock`
|
|
114
|
+
```bash
|
|
115
|
+
npm install @vanzxy/baileys
|
|
116
|
+
```
|
|
32
117
|
|
|
33
|
-
|
|
118
|
+
GitHub:
|
|
34
119
|
|
|
35
120
|
```bash
|
|
36
|
-
|
|
37
|
-
npm i @vanzxy/baileys
|
|
38
|
-
|
|
39
|
-
# Via GitHub
|
|
40
|
-
npm i github:vanzxy/baileys
|
|
121
|
+
npm install github:vanzxy/baileys
|
|
41
122
|
```
|
|
42
123
|
|
|
43
|
-
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
# π Quick Start
|
|
44
127
|
|
|
45
128
|
```js
|
|
46
|
-
// ESM
|
|
47
129
|
import { makeWASocket } from '@vanzxy/baileys'
|
|
130
|
+
|
|
131
|
+
const sock = makeWASocket({
|
|
132
|
+
printQRInTerminal: true
|
|
133
|
+
})
|
|
48
134
|
```
|
|
49
135
|
|
|
50
|
-
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
# π Recommended Environment
|
|
139
|
+
|
|
140
|
+
- Node.js 18+
|
|
141
|
+
- ESM Project
|
|
142
|
+
- Latest WhatsApp Multi Device
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
# π Fork Lineage
|
|
147
|
+
|
|
148
|
+
@vanzxy/baileys
|
|
149
|
+
βββ @itsliaaa/baileys
|
|
150
|
+
βββ WhiskeySockets/Baileys
|
|
151
|
+
|
|
152
|
+
Respect to all original maintainers and contributors.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
# π Maintainer
|
|
157
|
+
|
|
158
|
+
**Vanzxy**
|
|
159
|
+
|
|
160
|
+
GitHub:
|
|
161
|
+
https://github.com/vanzxy
|
|
162
|
+
|
|
163
|
+
Package:
|
|
164
|
+
@vanzxy/baileys
|
|
165
|
+
|
|
166
|
+
---
|
|
51
167
|
|
|
52
|
-
|
|
53
|
-
- [`@whiskeysockets/baileys`](https://github.com/WhiskeySockets/Baileys)
|
|
168
|
+
# β οΈ Disclaimer
|
|
54
169
|
|
|
55
|
-
|
|
170
|
+
This project is an independent fork.
|
|
171
|
+
Use responsibly and follow WhatsApp Terms of Service.
|
|
56
172
|
|
|
57
|
-
|
|
58
|
-
- [purpshell](https://github.com/purpshell), [jlucaso1](https://github.com/jlucaso1), [adiwajshing](https://github.com/adiwajshing) β WhiskeySockets/Baileys
|
|
59
|
-
- [Lia Wynn (itsliaaa)](https://github.com/itsliaaa) β @itsliaaa/baileys
|
|
173
|
+
---
|
|
60
174
|
|
|
61
|
-
|
|
175
|
+
Made with π by Vanzxy
|
package/lib/Defaults/index.js
CHANGED
|
@@ -8,8 +8,8 @@ export const BIZ_BOT_SUPPORT_PAYLOAD = '{"version":1,"is_ai_message":true,"shoul
|
|
|
8
8
|
export const DEFAULT_ORIGIN = 'https://web.whatsapp.com';
|
|
9
9
|
export const CALL_VIDEO_PREFIX = 'https://call.whatsapp.com/video/';
|
|
10
10
|
export const CALL_AUDIO_PREFIX = 'https://call.whatsapp.com/voice/';
|
|
11
|
-
export const DONATE_URL = '
|
|
12
|
-
export const LIBRARY_NAME = '
|
|
11
|
+
export const DONATE_URL = ''; // Vanz@Fix: cleared itsliaaa's donate URL fallback
|
|
12
|
+
export const LIBRARY_NAME = 'vanzxy/baileys';
|
|
13
13
|
export const DEF_CALLBACK_PREFIX = 'CB:';
|
|
14
14
|
export const DEF_TAG_PREFIX = 'TAG:';
|
|
15
15
|
export const PHONE_CONNECTION_CB = 'CB:Pong';
|
|
@@ -70,8 +70,12 @@ export const DEFAULT_CONNECTION_CONFIG = {
|
|
|
70
70
|
return syncType !== proto.HistorySync.HistorySyncType.FULL;
|
|
71
71
|
},
|
|
72
72
|
shouldIgnoreJid: () => false,
|
|
73
|
-
linkPreviewImageThumbnailWidth: 192,
|
|
73
|
+
linkPreviewImageThumbnailWidth: 480, // Vanz@Fix: was 192 β too small, bumped to 480
|
|
74
74
|
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
|
|
75
|
+
eventBufferTimeoutMs: 30000, // Vanz@Fix (bug 25): configurable β increase if bot is heavy load
|
|
76
|
+
statusBroadcastDelayMs: 1500, // Vanz@Fix (bug 5): configurable delay between status broadcasts β default 1500ms
|
|
77
|
+
albumDelayMs: 1500, // Vanz@Fix (bug 5): configurable delay between album message sends β default 1500ms
|
|
78
|
+
phashRetryEnabled: false, // Vanz@Fix (bug 54/55): enable phash retry on ack (caution: can cause loops if not careful)
|
|
75
79
|
generateHighQualityLinkPreview: true,
|
|
76
80
|
enableAutoSessionRecreation: true,
|
|
77
81
|
enableRecentMessageCache: true,
|
|
@@ -81,6 +85,9 @@ export const DEFAULT_CONNECTION_CONFIG = {
|
|
|
81
85
|
snapshot: false
|
|
82
86
|
},
|
|
83
87
|
countryCode: 'US',
|
|
88
|
+
// Vanz@Fix (bug 15): default returns undefined β every retry request will fail unless overridden.
|
|
89
|
+
// Override this in your makeWASocket config to return messages from your store:
|
|
90
|
+
// getMessage: async (key) => store.loadMessage(key.remoteJid, key.id)?.message
|
|
84
91
|
getMessage: async () => undefined,
|
|
85
92
|
cachedGroupMetadata: async () => undefined,
|
|
86
93
|
makeSignalRepository: makeLibSignalRepository
|