dtec-bail 1.0.7 β†’ 1.0.9

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 DanuZz ?
3
+ Copyright (c) 2025 Dew-Coders
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,42 +1,467 @@
1
- # Baileyz
1
+ <div align="center">
2
2
 
3
- [![npm version](https://badge.fury.io/js/baileyz.svg)](https://badge.fury.io/js/baileyz)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- [![Node.js Version](https://img.shields.io/node/v/baileyz.svg)](https://nodejs.org/)
6
- [![Downloads](https://img.shields.io/npm/dm/baileyz.svg)](https://npmjs.com/package/baileyz)
3
+ <div align="center">
4
+ <img src="https://capsule-render.vercel.app/api?type=speech&height=300&color=gradient&text=MOD%20BAIYLES&animation=blinking" width="100%">
5
+ </div>
6
+ <br>
7
+
8
+ <div style="background: linear-gradient(90deg, #6366F1, #3B82F6, #2DD4BF); padding: 8px; border-radius: 10px; margin: 15px 0;">
9
+ <span style="font-size: 18px; font-weight: bold; color: white;"><b>πŸ”₯Ultimate WhatsApp Web API<b></span>
10
+ </div>
11
+
12
+ ![TypeScript](https://img.shields.io/badge/-%F0%9F%94%B7%20TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white&labelColor=0D1117)
13
+ ![JavaScript](https://img.shields.io/badge/-%F0%9F%94%B8%20JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=F7DF1E&labelColor=0D1117)
14
+ ![WhatsApp](https://img.shields.io/badge/-%F0%9F%92%AC%20WhatsApp-25D366?style=for-the-badge&logo=whatsapp&logoColor=white&labelColor=0D1117)
15
+ ![NPM](https://img.shields.io/badge/-%F0%9F%93%A6%20npm-CB3837?style=for-the-badge&logo=npm&logoColor=white&labelColor=0D1117)
16
+ </div>
7
17
 
8
- <p align="center">
9
- <img src="https://github.com/dnuzi/mova-npm-media/blob/main/baileyz.gif" alt="Baileyz Thumbnail" width="500" />
10
- </p>
18
+ <br>
11
19
 
12
- **Baileyz** is a cutting-edge, open-source Node.js library for seamless WhatsApp automation and integration. Built on WebSocket technology, it bypasses browser dependencies to deliver lightweight, high-performance connections. Ideal for developers crafting bots, chat automations, customer service platforms, and dynamic communication tools, Baileyz empowers you with robust message handling, group management, interactive elements, and secure multi-device support.
20
+ <div align="center">
21
+ <img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&height=60&section=header" width="100%">
22
+ </div>
13
23
 
14
- Actively maintained with a focus on stability, security, and extensibility, Baileyz evolves alongside WhatsApp's ecosystem. Customize pairing with proprietary codes for uninterrupted sessions, and leverage modular design for effortless integration into any stackβ€”be it Express servers, serverless functions, or microservices.
15
-
16
- > **Developer**: [Yasas Dileepa](https://yasasdileepa.site) | **Repository**: [npmjs.com/package/baileyz](https://npmjs.com/package/baileyz)
24
+ <div style="border-left: 4px solid #3B82F6; padding-left: 15px; margin: 25px 0;">
25
+ <h2>⚑️ Supercharged WhatsApp API 🌟</h2>
26
+ <p><i>Elevate your messaging experience with the most advanced WhatsApp Web API solution available</i></p>
27
+ </div>
17
28
 
18
29
  ---
19
30
 
20
- ## 🌟 Key Features
31
+ ## ❓️ | WHY MOD-BAILEYS?
21
32
 
22
- - **Advanced Pairing & Authentication**: Auto-pairing with custom codes; resolves legacy disconnection issues for rock-solid reliability.
23
- - **Interactive Messaging Suite**: Native support for action buttons, dynamic menus, polls, events, and limited-time offers.
24
- - **Multi-Device Compatibility**: Fully aligned with WhatsApp's latest multi-device betaβ€”scale across phones and desktops.
25
- - **Session Management**: Intelligent auto-save/load for persistent, crash-resistant operations.
26
- - **Media & Content Handling**: Albums, documents (buffer-only), thumbnails, and product catalogs with seamless embedding.
27
- - **Utility Functions**: Channel ID extraction, ban checks, payment requests, and more for streamlined workflows.
28
- - **Lightweight & Modular**: Minimal footprint (~X KB gzipped); extend via plugins or hooks.
29
- - **TypeScript Ready**: Full typings for type-safe development; ES modules and CommonJS support.
33
+ <div style="display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin: 20px 0;">
34
+ <div style="background: rgba(45, 212, 191, 0.1); border-radius: 10px; padding: 15px; width: 180px; text-align: center;">
35
+ <div style="font-weight: bold;">⚑ Lightning Fast</div>
36
+ </div>
37
+ <div style="background: rgba(99, 102, 241, 0.1); border-radius: 10px; padding: 15px; width: 180px; text-align: center;">
38
+ <div style="font-weight: bold;">πŸ›‘οΈ Secure</div>
39
+ </div>
40
+ <div style="background: rgba(244, 114, 182, 0.1); border-radius: 10px; padding: 15px; width: 180px; text-align: center;">
41
+ <div style="font-weight: bold;">🧩 Feature-Rich</div>
42
+ </div>
43
+ <div style="background: rgba(234, 179, 8, 0.1); border-radius: 10px; padding: 15px; width: 180px; text-align: center;">
44
+ <div style="font-weight: bold;">πŸ”„ Active Development</div>
45
+ </div>
46
+ </div>
30
47
 
31
- ---
48
+ ## πŸ“Œ | IMPORTANT NOTE
49
+
50
+ <div style="background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05)); border-left: 4px solid #EF4444; padding: 15px; border-radius: 5px; margin: 20px 0;">
51
+ <p>⚠️ The original repository was initially removed by its creator and subsequently taken over by <a href="https://github.com/WhiskeySockets" style="color: #60A5FA; text-decoration: none; font-weight: bold;">WhiskeySockets</a>. This enhanced version includes numerous improvements and powerful new features designed to transform your WhatsApp development experience.</p>
52
+ </div>
53
+
54
+ ## πŸ’« | INSTALLATION
55
+
56
+ <div style="background: rgba(17, 24, 39, 0.6); border-radius: 8px; padding: 20px; margin: 20px 0;">
32
57
 
33
- ## πŸš€ Installation
58
+ ### πŸ“‚ In package.json:
59
+ ```json
60
+ "dependencies": {
61
+ "dew-baileys": "*"
62
+ }
63
+ ```
64
+ or option2
65
+ ### πŸ“‚ In package.json:
66
+ ```json
67
+ "dependencies": {
68
+ "@whiskeysockets/baileys": "github:dew-coders/Dew-Baileys"
69
+ }
70
+ ```
34
71
 
35
- Install via npm, yarn, or pnpm:
36
72
 
73
+ ### βš™οΈ Terminal Installation:
37
74
  ```bash
38
- npm install baileyz
39
- # or
40
- yarn add baileyz
41
- # or
42
- pnpm add baileyz
75
+ npm install dew-baileys
76
+ ```
77
+
78
+ ### πŸ”Œ Import:
79
+ <div style="display: flex; gap: 20px; flex-wrap: wrap;">
80
+ <div style="background: rgba(6, 182, 212, 0.1); border-radius: 5px; padding: 10px; flex: 1;">
81
+
82
+ ```typescript
83
+ // ESM
84
+ import makeWASocket from 'mod-baileys'
85
+ ```
86
+ </div>
87
+ <div style="background: rgba(234, 179, 8, 0.1); border-radius: 5px; padding: 10px; flex: 1;">
88
+
89
+ ```javascript
90
+ // CommonJS
91
+ const { default: makeWASocket } = require("mod-baileys")
92
+ ```
93
+ </div>
94
+ </div>
95
+ </div>
96
+
97
+ # How To Connect To Whatsapp
98
+ ## With QR Code
99
+ ```javascript
100
+ const {
101
+ default: makeWASocket
102
+ } = require('@whiskeysockets/baileys');
103
+
104
+ const client = makeWASocket({
105
+ browser: ['Ubuntu', 'Chrome', '20.00.1'],
106
+ printQRInTerminal: true
107
+ })
108
+ ```
109
+
110
+ ## Connect With Number
111
+ ```javascript
112
+ const {
113
+ default: makeWASocket,
114
+ fetchLatestWAWebVersion
115
+ } = require('@whiskeysockets/baileys');
116
+
117
+ const client = makeWASocket({
118
+ browser: ['Ubuntu', 'Chrome', '20.00.1'],
119
+ printQRInTerminal: false,
120
+ version: fetchLatestWAWebVersion()
121
+ // Other options
122
+ });
123
+
124
+ const number = "628XXXXX";
125
+ const code = await client.requestPairingCode(number.trim) /* Use : (number, "YYYYYYYY") for custom-pairing */
126
+
127
+ console.log("Ur pairing code : " + code)
128
+ ```
129
+
130
+
131
+ ## ✨ | FEATURE SHOWCASE
132
+
133
+ <div style="background: linear-gradient(45deg, rgba(124, 58, 237, 0.05), rgba(139, 92, 246, 0.05)); border-radius: 10px; padding: 15px; margin: 20px 0;">
134
+
135
+ ### πŸŽ€ Enhanced Features Matrix
136
+
137
+ | Feature | Description | Status |
138
+ |---------|-------------|--------|
139
+ | πŸ”Š **Channel Messaging** | Send & manage WhatsApp channel content | βœ… |
140
+ | πŸŽ›οΈ **Interactive Messages** | Create rich button-based experiences | βœ… |
141
+ | πŸ€– **AI Message Icon** | Brand your bot messages with AI icon | βœ… |
142
+ | πŸ–ΌοΈ **Enhanced Media** | Uncropped profile pictures & optimized media | βœ… |
143
+ | πŸ” **Custom Pairing** | Personalized device pairing codes | βœ… |
144
+ | πŸ”§ **Performance Optimizations** | Cleaner logs & improved signal handling | βœ… |
145
+ | πŸ“± **Cross-Platform** | Works on all NodeJS supported platforms | βœ… |
146
+ | ‴️ **2GB UPLOAD** | Works on all Up To 1GB Files Fast | βœ… |
147
+
148
+ </div>
149
+
150
+ <br>
151
+
152
+ <div style="display: flex; justify-content: center; margin: 30px 0;">
153
+ <div style="background: linear-gradient(135deg, #0EA5E9, #2DD4BF); color: white; padding: 12px 25px; border-radius: 25px; font-weight: bold; font-size: 16px;">🌱 SMALL BUT POWERFUL FEATURES πŸŽ‰</div>
154
+ </div>
155
+
156
+ ## πŸ“° | NEWSLETTER MANAGEMENT
157
+
158
+ <details>
159
+ <summary style="background: linear-gradient(90deg, #4F46E5, #7C3AED); color: white; padding: 10px 15px; border-radius: 5px; cursor: pointer; font-weight: bold;">πŸ“š Expand Newsletter Features</summary>
160
+
161
+ <div style="padding: 15px; background: rgba(79, 70, 229, 0.05); border-radius: 0 0 10px 10px; margin-top: -5px;">
162
+
163
+ ### πŸ“Š Get Newsletter Info
164
+ ```typescript
165
+ // By invite
166
+ const metadata = await sock.newsletterMetadata("invite", "xxxxx")
167
+ // By JID
168
+ const metadata = await sock.newsletterMetadata("jid", "abcd@newsletter")
169
+ console.log(metadata)
170
+ ```
171
+
172
+ ### πŸ“ Update Newsletter Content
173
+ ```typescript
174
+ // Update description
175
+ await sock.newsletterUpdateDescription("abcd@newsletter", "New Description")
176
+
177
+ // Update name
178
+ await sock.newsletterUpdateName("abcd@newsletter", "New Name")
179
+
180
+ // Update picture
181
+ await sock.newsletterUpdatePicture("abcd@newsletter", buffer)
182
+
183
+ // Remove picture
184
+ await sock.newsletterRemovePicture("abcd@newsletter")
185
+ ```
186
+
187
+ ### πŸ”” Notification Management
188
+ ```typescript
189
+ // Unmute newsletter
190
+ await sock.newsletterUnmute("abcd@newsletter")
191
+
192
+ // Mute newsletter
193
+ await sock.newsletterMute("abcd@newsletter")
194
+ ```
195
+
196
+ ### πŸ”„ Newsletter Management
197
+ ```typescript
198
+ // Create new newsletter
199
+ const metadata = await sock.newsletterCreate("Newsletter Name", "Newsletter Description")
200
+ console.log(metadata)
201
+
202
+ // Delete newsletter
203
+ await sock.newsletterDelete("abcd@newsletter")
204
+
205
+ // Follow newsletter
206
+ await sock.newsletterFollow("abcd@newsletter")
207
+
208
+ // Unfollow newsletter
209
+ await sock.newsletterUnfollow("abcd@newsletter")
210
+ ```
211
+
212
+ ### πŸ˜€ Engagement Features
213
+ ```typescript
214
+ // Send reaction to newsletter post
215
+ // Get ID from message URL: https://whatsapp.com/channel/xxxxx/175
216
+ const id = "175"
217
+ await sock.newsletterReactMessage("abcd@newsletter", id, "πŸ₯³")
218
+ ```
219
+
220
+ </div>
221
+ </details>
222
+
223
+ ## πŸŽ›οΈ | INTERACTIVE MESSAGING
224
+
225
+ <details>
226
+ <summary style="background: linear-gradient(90deg, #EC4899, #F43F5E); color: white; padding: 10px 15px; border-radius: 5px; cursor: pointer; font-weight: bold;">🎯 Expand Button & Interactive Features</summary>
227
+
228
+ <div style="padding: 15px; background: rgba(236, 72, 153, 0.05); border-radius: 0 0 10px 10px; margin-top: -5px;">
229
+
230
+ ### πŸ“ Text Buttons
231
+ ```typescript
232
+ const buttons = [
233
+ { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
234
+ { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
235
+ ]
236
+
237
+ const buttonMessage = {
238
+ text: "Hi it's button message",
239
+ footer: 'Hello World',
240
+ buttons,
241
+ headerType: 1,
242
+ viewOnce: true
243
+ }
244
+
245
+ await sock.sendMessage(id, buttonMessage, { quoted: null })
246
+ ```
247
+
248
+ ### πŸ–ΌοΈ Image Buttons
249
+ ```typescript
250
+ const buttons = [
251
+ { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
252
+ { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
253
+ ]
254
+
255
+ const buttonMessage = {
256
+ image: { url: "https://example.com/abcd.jpg" }, // image: buffer or path
257
+ caption: "Hi it's button message with image",
258
+ footer: 'Hello World',
259
+ buttons,
260
+ headerType: 1,
261
+ viewOnce: true
262
+ }
263
+
264
+ await sock.sendMessage(id, buttonMessage, { quoted: null })
265
+ ```
266
+
267
+ ### 🎬 Video Buttons
268
+ ```typescript
269
+ const buttons = [
270
+ { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
271
+ { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
272
+ ]
273
+
274
+ const buttonMessage = {
275
+ video: { url: "https://example.com/abcd.mp4" }, // video: buffer or path
276
+ caption: "Hi it's button message with video",
277
+ footer: 'Hello World',
278
+ buttons,
279
+ headerType: 1,
280
+ viewOnce: true
281
+ }
282
+
283
+ await sock.sendMessage(id, buttonMessage, { quoted: null })
284
+ ```
285
+
286
+ ### πŸ”„ Advanced Interactive Messages
287
+ ```typescript
288
+ const interactiveButtons = [
289
+ {
290
+ name: "quick_reply",
291
+ buttonParamsJson: JSON.stringify({
292
+ display_text: "Quick Reply",
293
+ id: "ID"
294
+ })
295
+ },
296
+ {
297
+ name: "cta_url",
298
+ buttonParamsJson: JSON.stringify({
299
+ display_text: "Tap Here!",
300
+ url: "https://www.example.com/"
301
+ })
302
+ },
303
+ {
304
+ name: "cta_copy",
305
+ buttonParamsJson: JSON.stringify({
306
+ display_text: "Copy Code",
307
+ id: "12345",
308
+ copy_code: "12345"
309
+ })
310
+ }
311
+ ]
312
+
313
+ const interactiveMessage = {
314
+ text: "Hello World!",
315
+ title: "this is the title",
316
+ footer: "this is the footer",
317
+ interactiveButtons
318
+ }
319
+
320
+ await sock.sendMessage(id, interactiveMessage, { quoted: null })
321
+ ```
322
+
323
+ ### πŸ–ΌοΈ Rich Media Interactive Messages
324
+ ```typescript
325
+ const interactiveButtons = [
326
+ {
327
+ name: "quick_reply",
328
+ buttonParamsJson: JSON.stringify({
329
+ display_text: "Quick Reply",
330
+ id: "ID"
331
+ })
332
+ },
333
+ {
334
+ name: "cta_url",
335
+ buttonParamsJson: JSON.stringify({
336
+ display_text: "Visit Website",
337
+ url: "https://www.example.com/"
338
+ })
339
+ }
340
+ ]
341
+
342
+ // With Image
343
+ const imageInteractiveMessage = {
344
+ image: { url: "https://example.com/abcd.jpg" },
345
+ caption: "Check out this amazing photo!",
346
+ title: "Photo Showcase",
347
+ footer: "Tap a button below",
348
+ interactiveButtons
349
+ }
350
+
351
+ await sock.sendMessage(id, imageInteractiveMessage, { quoted: null })
352
+
353
+ // With Video
354
+ const videoInteractiveMessage = {
355
+ video: { url: "https://example.com/abcd.mp4" },
356
+ caption: "Watch this awesome video!",
357
+ title: "Video Showcase",
358
+ footer: "Tap a button below",
359
+ interactiveButtons
360
+ }
361
+
362
+ await sock.sendMessage(id, videoInteractiveMessage, { quoted: null })
363
+ ```
364
+
365
+ </div>
366
+ </details>
367
+
368
+ ## πŸ€– | AI MESSAGING
369
+
370
+ <div style="background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1)); border-radius: 10px; padding: 20px; margin: 20px 0;">
371
+
372
+ ### AI Icon Feature
373
+ ```typescript
374
+ // Simply add "ai: true" to display AI icon with your message
375
+ await sock.sendMessage(id, { text: "Hello! I'm your AI assistant.", ai: true })
376
+ ```
377
+
378
+ <div style="background: rgba(16, 185, 129, 0.2); border-radius: 5px; padding: 10px; margin-top: 15px;">
379
+ <strong>πŸ’‘ Pro Tip:</strong> AI icons make your bot messages stand out and indicate automated responses to users.
380
+ </div>
381
+
382
+ </div>
383
+
384
+ ## πŸ” | CUSTOM PAIRING
385
+
386
+ <div style="background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1)); border-radius: 10px; padding: 20px; margin: 20px 0;">
387
+
388
+ ### Custom Code Implementation
389
+ ```typescript
390
+ if(usePairingCode && !sock.authState.creds.registered) {
391
+ const phoneNumber = await question('Please enter your mobile phone number:\n')
392
+ const custom = "DEWMDOFC" // must be 8 digits, can be letters or numbers
393
+ const code = await sock.requestPairingCode(phoneNumber, custom)
394
+ console.log(`Pairing code: ${code?.match(/.{1,4}/g)?.join('-') || code}`)
395
+ }
396
+ ```
397
+
398
+ <div style="background: rgba(245, 158, 11, 0.2); border-radius: 5px; padding: 10px; margin-top: 15px;">
399
+ <strong>πŸ”’ Security Note:</strong> Custom pairing codes enhance security while providing a personalized experience.
400
+ </div>
401
+
402
+ </div>
403
+
404
+ <div align="center">
405
+ <img src="https://capsule-render.vercel.app/api?type=rect&color=gradient&height=2&section=header" width="100%">
406
+ </div>
407
+
408
+ ## πŸ› οΈ | QUICK IMPLEMENTATION GUIDE
409
+
410
+ <div style="display: flex; flex-wrap: wrap; gap: 15px; margin: 20px 0;">
411
+ <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
412
+ <h3>πŸš€ Step 1: Install</h3>
413
+ <p>Add baileys-elite to your project using npm</p>
414
+ <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
415
+ <code>npm install dew-baileys</code>
416
+ </div>
417
+ </div>
418
+
419
+ <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
420
+ <h3>πŸ”„ Step 2: Import</h3>
421
+ <p>Import the library into your project</p>
422
+ <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
423
+ <code>import makeWASocket from 'dew-baileys'</code>
424
+ </div>
425
+ </div>
426
+
427
+ <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
428
+ <h3>βš™οΈ Step 3: Configure</h3>
429
+ <p>Set up your WhatsApp connection</p>
430
+ <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
431
+ <code>const sock = makeWASocket({...})</code>
432
+ </div>
433
+ </div>
434
+
435
+ <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
436
+ <h3>πŸš€ Step 4: Implement</h3>
437
+ <p>Start using the enhanced features</p>
438
+ <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
439
+ <code>await sock.sendMessage(id, {...})</code>
440
+ </div>
441
+ </div>
442
+ </div>
443
+
444
+ ## πŸ› | REPORTING ISSUES
445
+
446
+ <div style="background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(220, 38, 38, 0.05)); border-radius: 10px; padding: 20px; margin: 20px 0;">
447
+ <h3>Found a bug? Have a suggestion?</h3>
448
+ <p>If you encounter any issues while using this repository, please feel free to open a <a href="https://github.com/dew-coders/Dew-Baileys/issues" style="color: #60A5FA; text-decoration: none; font-weight: bold;">new issue</a>.</p>
449
+
450
+ <div style="display: flex; align-items: center; gap: 10px; margin-top: 15px; background: rgba(239, 68, 68, 0.1); padding: 10px; border-radius: 5px;">
451
+ <span style="font-size: 24px;">πŸ‘Ύ</span>
452
+ <span>Our team actively monitors and responds to all issues.</span>
453
+ </div>
454
+ </div>
455
+
456
+ ## πŸ“ | NOTES
457
+
458
+ <div style="background: linear-gradient(135deg, rgba(107, 114, 128, 0.05), rgba(75, 85, 99, 0.05)); border-radius: 10px; padding: 20px; margin: 20px 0;">
459
+ <p>Everything other than the modifications mentioned above remains the same as the original repository. You can check out the original repository at <a href="https://github.com/WhiskeySockets/Baileys" style="color: #60A5FA; text-decoration: none; font-weight: bold;">WhiskeySockets</a>.</p>
460
+ </div>
461
+
462
+
463
+ <p style="font-style: italic; max-width: 600px; margin: 0 auto;">Powered BY Dew Coders - The Ultimate WhatsApp Web API Experience</p>
464
+ </div>
465
+ <div align="center">
466
+ <img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&height=100&section=footer" width="100%">
467
+ </div>
@@ -2,18 +2,9 @@ const major = parseInt(process.versions.node.split('.')[0], 10);
2
2
 
3
3
  if (major < 20) {
4
4
  console.error(
5
- `\n` +
6
- `πŸ”΄ Oh no! 🚨\n` +
7
- `\n` +
8
- ` The package **baileyz** requires Node.js 20+ to run reliably.\n` +
9
- ` You're currently on Node.js ${process.versions.node}. πŸ˜”\n` +
10
- `\n` +
11
- ` πŸ’‘ Quick fix: Upgrade to Node.js 20+ (recommended: latest LTS)!\n` +
12
- ` Download from https://nodejs.org/ or use a version manager like nvm.\n` +
13
- `\n` +
14
- ` Once upgraded, try running your command again. πŸŽ‰\n` +
15
- `\n` +
16
- ` (Exiting now to avoid any issues...)\n`
5
+ `\n❌ This package requires Node.js 20+ to run reliably.\n` +
6
+ ` You are using Node.js ${process.versions.node}.\n` +
7
+ ` Please upgrade to Node.js 20+ to proceed.\n`
17
8
  );
18
9
  process.exit(1);
19
- }
10
+ }
@@ -0,0 +1,74 @@
1
+ "use strict"
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true })
4
+
5
+ const UNAUTHORIZED_CODES = [401, 403, 419]
6
+
7
+ const PHONENUMBER_MCC = require("./phonenumber-mcc.json")
8
+
9
+ const DEFAULT_ORIGIN = 'https://web.whatsapp.com'
10
+
11
+ const PHONE_CONNECTION_CB = 'CB:Pong'
12
+
13
+ const WA_ADV_ACCOUNT_SIG_PREFIX = Buffer.from([6, 0])
14
+
15
+ const WA_ADV_DEVICE_SIG_PREFIX = Buffer.from([6, 1])
16
+
17
+ const WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX = Buffer.from([6, 5])
18
+
19
+ const WA_ADV_HOSTED_DEVICE_SIG_PREFIX = Buffer.from([6, 6])
20
+
21
+ const WA_DEFAULT_EPHEMERAL = 7 * 24 * 60 * 60
22
+
23
+ const NOISE_MODE = 'Noise_XX_25519_AESGCM_SHA256\0\0\0\0'
24
+
25
+ const DICT_VERSION = 3
26
+
27
+ const KEY_BUNDLE_TYPE = Buffer.from([5])
28
+
29
+ const NOISE_WA_HEADER = Buffer.from([87, 65, 6, DICT_VERSION]) // last is "DICT_VERSION"
30
+
31
+ /** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
32
+ const URL_REGEX = /https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g
33
+
34
+ const MIN_PREKEY_COUNT = 5
35
+
36
+ const INITIAL_PREKEY_COUNT = 812
37
+
38
+ const UPLOAD_TIMEOUT = 30000 // 30 seconds
39
+
40
+ const MIN_UPLOAD_INTERVAL = 5000 // seconds minimum between uploads
41
+
42
+ const WA_CERT_DETAILS = {
43
+ SERIAL: 0
44
+ }
45
+
46
+ const DEFAULT_CACHE_TTLS = {
47
+ SIGNAL_STORE: 5 * 60,
48
+ MSG_RETRY: 60 * 60,
49
+ CALL_OFFER: 5 * 60,
50
+ USER_DEVICES: 5 * 60, // 5 minutes
51
+ }
52
+
53
+ module.exports = {
54
+ UNAUTHORIZED_CODES,
55
+ PHONENUMBER_MCC,
56
+ DEFAULT_ORIGIN,
57
+ PHONE_CONNECTION_CB,
58
+ WA_ADV_ACCOUNT_SIG_PREFIX,
59
+ WA_ADV_DEVICE_SIG_PREFIX,
60
+ WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX,
61
+ WA_ADV_HOSTED_DEVICE_SIG_PREFIX,
62
+ WA_DEFAULT_EPHEMERAL,
63
+ NOISE_MODE,
64
+ DICT_VERSION,
65
+ KEY_BUNDLE_TYPE,
66
+ NOISE_WA_HEADER,
67
+ URL_REGEX,
68
+ MIN_PREKEY_COUNT,
69
+ MIN_UPLOAD_INTERVAL,
70
+ INITIAL_PREKEY_COUNT,
71
+ UPLOAD_TIMEOUT,
72
+ WA_CERT_DETAILS,
73
+ DEFAULT_CACHE_TTLS
74
+ }
@@ -0,0 +1,48 @@
1
+ "use strict"
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true })
4
+
5
+ const MEDIA_PATH_MAP = {
6
+ image: '/mms/image',
7
+ video: '/mms/video',
8
+ document: '/mms/document',
9
+ audio: '/mms/audio',
10
+ sticker: '/mms/image',
11
+ 'sticker-pack': '/mms/sticker',
12
+ 'thumbnail-link': '/mms/image',
13
+ 'product-catalog-image': '/product/image',
14
+ 'md-app-state': '',
15
+ 'md-msg-hist': '/mms/md-app-state',
16
+ 'biz-cover-photo': '/pps/biz-cover-photo'
17
+ }
18
+
19
+ const MEDIA_HKDF_KEY_MAPPING = {
20
+ 'audio': 'Audio',
21
+ 'document': 'Document',
22
+ 'gif': 'Video',
23
+ 'image': 'Image',
24
+ 'ppic': '',
25
+ 'product': 'Image',
26
+ 'ptt': 'Audio',
27
+ 'video': 'Video',
28
+ 'sticker': 'Image',
29
+ 'sticker-pack': 'Sticker Pack',
30
+ 'thumbnail-document': 'Document Thumbnail',
31
+ 'thumbnail-image': 'Image Thumbnail',
32
+ 'thumbnail-video': 'Video Thumbnail',
33
+ 'thumbnail-link': 'Link Thumbnail',
34
+ 'md-msg-hist': 'History',
35
+ 'md-app-state': 'App State',
36
+ 'product-catalog-image': '',
37
+ 'payment-bg-image': 'Payment Background',
38
+ 'ptv': 'Video',
39
+ 'biz-cover-photo': 'Image'
40
+ }
41
+
42
+ const MEDIA_KEYS = Object.keys(MEDIA_PATH_MAP)
43
+
44
+ module.exports = {
45
+ MEDIA_KEYS,
46
+ MEDIA_PATH_MAP,
47
+ MEDIA_HKDF_KEY_MAPPING
48
+ }