kashmiribailey 2.0.6 → 2.7.8

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.
Files changed (111) hide show
  1. package/README.md +420 -93
  2. package/WAProto/fix-import.js +29 -0
  3. package/WAProto/index.js +65432 -137443
  4. package/engine-requirements.js +10 -0
  5. package/lib/Defaults/baileys-version.json +2 -2
  6. package/lib/Defaults/index.d.ts +7 -16
  7. package/lib/Defaults/index.js +124 -94
  8. package/lib/Socket/Client/index.d.ts +3 -2
  9. package/lib/Socket/Client/index.js +3 -2
  10. package/lib/Socket/business.d.ts +58 -59
  11. package/lib/Socket/chats.d.ts +230 -45
  12. package/lib/Socket/chats.js +238 -139
  13. package/lib/Socket/groups.d.ts +32 -41
  14. package/lib/Socket/groups.js +23 -38
  15. package/lib/Socket/index.d.ts +64 -63
  16. package/lib/Socket/index.js +3 -2
  17. package/lib/Socket/{dugong.d.ts → luxu.d.ts} +61 -37
  18. package/lib/Socket/luxu.js +620 -0
  19. package/lib/Socket/messages-recv.js +65 -9
  20. package/lib/Socket/messages-send.d.ts +47 -49
  21. package/lib/Socket/messages-send.js +403 -544
  22. package/lib/Socket/newsletter.d.ts +37 -39
  23. package/lib/Socket/newsletter.js +305 -1
  24. package/lib/Socket/socket.d.ts +44 -270
  25. package/lib/Socket/socket.js +90 -8
  26. package/lib/Socket/usync.d.ts +3 -3
  27. package/lib/Store/index.d.ts +2 -1
  28. package/lib/Store/index.js +3 -1
  29. package/lib/Store/make-in-memory-store.d.ts +24 -24
  30. package/lib/Store/make-in-memory-store.js +14 -26
  31. package/lib/Store/make-ordered-dictionary.d.ts +1 -1
  32. package/lib/Store/make-ordered-dictionary.js +2 -2
  33. package/lib/Types/Auth.d.ts +7 -0
  34. package/lib/Types/Call.d.ts +1 -1
  35. package/lib/Types/Chat.d.ts +7 -14
  36. package/lib/Types/Contact.d.ts +1 -5
  37. package/lib/Types/Events.d.ts +2 -44
  38. package/lib/Types/GroupMetadata.d.ts +2 -11
  39. package/lib/Types/Label.js +1 -1
  40. package/lib/Types/LabelAssociation.js +1 -1
  41. package/lib/Types/Message.d.ts +21 -148
  42. package/lib/Types/Message.js +2 -0
  43. package/lib/Types/Newsletter.d.ts +97 -73
  44. package/lib/Types/Newsletter.js +38 -18
  45. package/lib/Types/Socket.d.ts +9 -17
  46. package/lib/Types/index.d.ts +1 -8
  47. package/lib/Types/index.js +2 -2
  48. package/lib/Utils/auth-utils.d.ts +3 -3
  49. package/lib/Utils/auth-utils.js +13 -6
  50. package/lib/Utils/business.js +2 -2
  51. package/lib/Utils/chat-utils.d.ts +16 -15
  52. package/lib/Utils/chat-utils.js +35 -36
  53. package/lib/Utils/crypto.d.ts +16 -15
  54. package/lib/Utils/crypto.js +29 -71
  55. package/lib/Utils/decode-wa-message.d.ts +6 -22
  56. package/lib/Utils/decode-wa-message.js +56 -65
  57. package/lib/Utils/event-buffer.d.ts +2 -2
  58. package/lib/Utils/event-buffer.js +7 -11
  59. package/lib/Utils/generics.d.ts +20 -17
  60. package/lib/Utils/generics.js +84 -102
  61. package/lib/Utils/history.d.ts +0 -4
  62. package/lib/Utils/history.js +6 -4
  63. package/lib/Utils/link-preview.d.ts +2 -2
  64. package/lib/Utils/link-preview.js +1 -34
  65. package/lib/Utils/logger.d.ts +3 -10
  66. package/lib/Utils/lt-hash.d.ts +2 -2
  67. package/lib/Utils/lt-hash.js +6 -6
  68. package/lib/Utils/make-mutex.d.ts +2 -2
  69. package/lib/Utils/messages-media.d.ts +24 -28
  70. package/lib/Utils/messages-media.js +111 -272
  71. package/lib/Utils/messages.d.ts +10 -13
  72. package/lib/Utils/messages.js +53 -338
  73. package/lib/Utils/noise-handler.d.ts +12 -10
  74. package/lib/Utils/noise-handler.js +23 -18
  75. package/lib/Utils/process-message.d.ts +4 -5
  76. package/lib/Utils/process-message.js +25 -108
  77. package/lib/Utils/signal.d.ts +1 -2
  78. package/lib/Utils/signal.js +26 -26
  79. package/lib/Utils/use-multi-file-auth-state.d.ts +1 -0
  80. package/lib/Utils/use-multi-file-auth-state.js +0 -6
  81. package/lib/Utils/validate-connection.d.ts +4 -3
  82. package/lib/Utils/validate-connection.js +1 -1
  83. package/lib/WABinary/constants.d.ts +27 -24
  84. package/lib/WABinary/constants.js +13 -1276
  85. package/lib/WABinary/decode.d.ts +4 -3
  86. package/lib/WABinary/decode.js +13 -26
  87. package/lib/WABinary/encode.d.ts +2 -1
  88. package/lib/WABinary/encode.js +152 -137
  89. package/lib/WABinary/generic-utils.d.ts +4 -1
  90. package/lib/WABinary/generic-utils.js +125 -37
  91. package/lib/WABinary/jid-utils.d.ts +5 -11
  92. package/lib/WABinary/jid-utils.js +5 -28
  93. package/lib/WAM/BinaryInfo.d.ts +11 -2
  94. package/lib/WAM/encode.d.ts +2 -1
  95. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
  96. package/lib/index.d.ts +2 -6
  97. package/lib/index.js +28 -24
  98. package/package.json +40 -36
  99. package/WAProto/GenerateStatics.sh +0 -4
  100. package/WAProto/WAProto.proto +0 -4775
  101. package/WAProto/index.d.ts +0 -55057
  102. package/WAProto/index.ts.ts +0 -53473
  103. package/lib/Socket/Client/types.d.ts +0 -16
  104. package/lib/Socket/Client/types.js +0 -13
  105. package/lib/Socket/Client/websocket.d.ts +0 -13
  106. package/lib/Socket/Client/websocket.js +0 -111
  107. package/lib/Socket/dugong.js +0 -1
  108. package/lib/Socket/setup.js +0 -481
  109. package/lib/Socket/setup.ts +0 -623
  110. package/lib/WABinary/jid-utils.js.bak +0 -83
  111. package/lib/WAUSync/index.d.ts +0 -3
package/README.md CHANGED
@@ -1,116 +1,443 @@
1
- <h1 align="center">
2
- KASHMIRI
3
- </h1>
1
+ # KASHMIRI BAILEYS
4
2
 
5
3
  <p align="center">
6
- <img src="https://dabby.vercel.app/menu.jpg" width="400" style="border-radius:8px;">
4
+ <img src="https://files.catbox.moe/tjpzcl.jpg" alt="Thumbnail" />
7
5
  </p>
8
6
 
9
- <p align="center">
10
- <strong>Enterprise-Grade WhatsApp Business API</strong>
11
- </p>
7
+ KASHMIRI is an open-source library designed to help developers build automation solutions and integrations with WhatsApp efficiently and directly. Using websocket technology without the need for a browser, this library supports a wide range of features such as message management, chat handling, group administration, as well as interactive messages and action buttons for a more dynamic user experience.
12
8
 
13
- <p align="center">
14
- <sub>High-performance modified Baileys library for scalable WhatsApp integrations</sub>
15
- </p>
9
+ Actively developed and maintained, KASHMIRI Baileys continuously receives updates to enhance stability and performance. One of the main focuses is to improve the pairing and authentication processes to be more stable and secure. Pairing features can be customized with your own codes, making the process more reliable and less prone to interruptions.
10
+
11
+ This library is highly suitable for building business bots, chat automation systems, customer service solutions, and various other communication automation applications that require high stability and comprehensive features. With a lightweight and modular design, KASHMIRI Baileys is easy to integrate into different systems and platforms.
16
12
 
17
13
  ---
18
14
 
19
- # 🎀 KASHMIRI
15
+ ### Main Features and Advantages
16
+
17
+ - Supports automatic and custom pairing processes
18
+ - Fixes previous pairing issues that often caused failures or disconnections
19
+ - Supports interactive messages, action buttons, and dynamic menus
20
+ - Efficient automatic session management for reliable operation
21
+ - Compatible with the latest multi-device features from WhatsApp
22
+ - Lightweight, stable, and easy to integrate into various systems
23
+ - Suitable for developing bots, automation, and complete communication solutions
24
+ - Comprehensive documentation and example codes to facilitate development
20
25
 
21
- > **KASHMIRI** a mod og *Baileys WhatsApp Web API* by **KASHMIRI**
22
26
  ---
23
27
 
24
- ## Mafeatures
25
- ✅ Stabil & lasts long
28
+ ## Getting Started
26
29
 
27
- Support multi-device (MD)
30
+ Begin by installing the library via your preferred package manager, then follow the provided configuration guide. You can also utilize the ready-made example codes to understand how the features work. Use session storage and interactive messaging features to build complete, stable solutions tailored to your business or project needs.
28
31
 
29
- ✅ Support buttons
32
+ ---
30
33
 
31
- SSupport Custom Pairing Code
34
+ ## Add Function ( Simple code )
32
35
 
33
- Support Group
36
+ ### Label Group
37
+ Tag/Label Member Group
34
38
 
39
+ ```javascript
40
+ sock.setLabelGroup(jid, string)
41
+ ```
35
42
  ---
43
+ ### Check ID Channel
44
+ Get ID Channel From Url
36
45
 
37
- ## 📦 Installation
38
- Install npm
39
- ```bash
40
- npm i kashmiribailey
41
-
42
-
43
- ## Handling Events
44
-
45
- - Baileys uses the EventEmitter syntax for events.
46
- They're all nicely typed up, so you shouldn't have any issues with an Intellisense editor like VS Code.
47
-
48
- > [!IMPORTANT]
49
- > **The events are [these](https://baileys.whiskeysockets.io/types/BaileysEventMap.html)**, it's important you see all events
50
-
51
- You can listen to these events like this:
52
- ```ts
53
- const sock = makeWASocket()
54
- sock.ev.on('messages.upsert', ({ messages }) => {
55
- console.log('got messages', messages)
56
- })
57
- ```
58
- This is a fix mention @lid for bots working in groups
59
-
60
- ```js
61
-
62
- sock.ev.on('messages.upsert', async chatUpdate => {
63
- try {
64
- mek = chatUpdate.messages[0]
65
- if (!mek.message) return
66
- mek.message = (Object.keys(mek.message)[0] === 'ephemeralMessage') ? mek.message.ephemeralMessage.message : mek.message
67
- const m = mek
68
- const isGroup = m.key.remoteJid.endsWith('@g.us');
69
- const mentionedJid = mek.message?.extendedTextMessage?.contextInfo?.mentionedJid || [];
70
- if (isGroup && Array.isArray(mentionedJid) && mentionedJid.some(j => j.endsWith('@lid'))) {
71
- const groupMetadata = await sock.groupMetadata(mek.key.remoteJid);
72
- const resolvedMentions = mentionedJid.map(jid => {
73
- if (jid.endsWith('@lid')) {
74
- const match = groupMetadata.participants.find(p => p.id === jid);
75
- return match?.jid || jid;
76
- }
77
- return jid;
78
- });
79
- mek.message.extendedTextMessage.contextInfo.mentionedJid = resolvedMentions;
80
- const lidMap = {};
81
- mentionedJid.forEach(originalLid => {
82
- if (originalLid.endsWith('@lid')) {
83
- const match = groupMetadata.participants.find(p => p.id === originalLid);
84
- if (match && match.jid) {
85
- const jidNumber = match.jid.split('@')[0];
86
- const lidNumber = originalLid.split('@')[0];
87
- lidMap[lidNumber] = jidNumber;
88
- }
89
- }
90
- });
91
- const replaceLidInText = (text) => {
92
- if (!text) return text;
93
- Object.entries(lidMap).forEach(([lidNum, jidNum]) => {
94
- const regex = new RegExp(`@${lidNum}\\b`, 'g');
95
- text = text.replace(regex, `@${jidNum}`);
96
- });
97
- return text;
98
- };
99
- if (mek.message.conversation) {
100
- mek.message.conversation = replaceLidInText(mek.message.conversation);
101
- }
102
- if (mek.message.extendedTextMessage?.text) {
103
- mek.message.extendedTextMessage.text = replaceLidInText(mek.message.extendedTextMessage.text);
104
- }
105
- let msg = {
106
- messages: [proto.WebMessageInfo.fromObject(mek)],
107
- type: "append",
108
- };
109
- return conn.ev.emit("messages.upsert", msg);
46
+ ```javascript
47
+ sock.newsletterFromUrl(url)
48
+ ```
49
+ Result JSON
50
+ ```json
51
+ {
52
+ "name": "Name Channel",
53
+ "id": "Channel ID",
54
+ "state": "Status Channel",
55
+ "subscribers": "Followers",
56
+ "verification": "UNVERIFIED",
57
+ "creation_time": 1728547155,
58
+ "description": "Description Channel"
110
59
  }
111
- } catch (err) {
60
+ ```
61
+ ---
62
+ ### Check banned number
63
+ You can see the status of blocked numbers here
112
64
 
113
- }
65
+ ```javascript
66
+ sock.checkWhatsApp(jid)
67
+ ```
68
+ ---
69
+
70
+ ## SendMessage Documentation
71
+
72
+ ### Status Mention Group & Private Message
73
+ Send Status Mention Group/Private Chat
74
+
75
+ ```javascript
76
+ await sock.sendStatusMention(content, jid);
77
+ ```
78
+
79
+ ### Status Group Message V2
80
+ Send Group Status With Version 2
81
+
82
+ ```javascript
83
+ await sock.sendMessage(jid, {
84
+ groupStatusMessage: {
85
+ text: "Hello World"
86
+ }
114
87
  });
88
+ ```
115
89
 
90
+ ### Album Message (Multiple Images)
91
+ Send multiple images in a single album message:
92
+
93
+ ```javascript
94
+ await sock.sendMessage(jid, {
95
+ albumMessage: [
96
+ { image: cihuy, caption: "Foto pertama" },
97
+ { image: { url: "URL IMAGE" }, caption: "hy }
98
+ ]
99
+ }, { quoted: m });
116
100
  ```
101
+
102
+ ### Event Message
103
+ Create and send WhatsApp event invitations:
104
+
105
+ ```javascript
106
+ await sock.sendMessage(jid, {
107
+ eventMessage: {
108
+ isCanceled: false,
109
+ name: "Hello World",
110
+ description: "kashmiribailey",
111
+ location: {
112
+ degreesLatitude: 0,
113
+ degreesLongitude: 0,
114
+ name: "rowrrrr"
115
+ },
116
+ joinLink: "https://call.whatsapp.com/video/saweitt",
117
+ startTime: "1763019000",
118
+ endTime: "1763026200",
119
+ extraGuestsAllowed: false
120
+ }
121
+ }, { quoted: m });
122
+ ```
123
+
124
+ ### Poll Result Message
125
+ Display poll results with vote counts:
126
+
127
+ ```javascript
128
+ await sock.sendMessage(jid, {
129
+ pollResultMessage: {
130
+ name: "Hello World",
131
+ pollVotes: [
132
+ {
133
+ optionName: "TEST 1",
134
+ optionVoteCount: "112233"
135
+ },
136
+ {
137
+ optionName: "TEST 2",
138
+ optionVoteCount: "1"
139
+ }
140
+ ]
141
+ }
142
+ }, { quoted: m });
143
+ ```
144
+
145
+ ### Simple Interactive Message
146
+ Send basic interactive messages with copy button functionality:
147
+
148
+ ```javascript
149
+ await sock.sendMessage(jid, {
150
+ interactiveMessage: {
151
+ header: "Hello World",
152
+ title: "Hello World",
153
+ footer: "KASHMIRI Baileys",
154
+ buttons: [
155
+ {
156
+ name: "cta_copy",
157
+ buttonParamsJson: JSON.stringify({
158
+ display_text: "copy code",
159
+ id: "123456789",
160
+ copy_code: "ABC123XYZ"
161
+ })
162
+ }
163
+ ]
164
+ }
165
+ }, { quoted: m });
166
+ ```
167
+
168
+ ### Interactive Message with Native Flow
169
+ Send interactive messages with buttons, copy actions, and native flow features:
170
+
171
+ ```javascript
172
+ await sock.sendMessage(jid, {
173
+ interactiveMessage: {
174
+ header: "Hello World",
175
+ title: "Hello World",
176
+ footer: "KASHMIRIBOTSINC Baileys",
177
+ image: { url: "https://files.catbox.moe/tjpzcl.jpg" },
178
+ nativeFlowMessage: {
179
+ messageParamsJson: JSON.stringify({
180
+ limited_time_offer: {
181
+ text: "idk hummmm?",
182
+ url: "https://t.me/KASHMIRIBOTSINC",
183
+ copy_code: "kashmiribailey",
184
+ expiration_time: Date.now() * 999
185
+ },
186
+ bottom_sheet: {
187
+ in_thread_buttons_limit: 2,
188
+ divider_indices: [1, 2, 3, 4, 5, 999],
189
+ list_title: "KASHMIRI",
190
+ button_title: "KASHMIRI BAILEY"
191
+ },
192
+ tap_target_configuration: {
193
+ title: " KASHMIRIBOTSINc",
194
+ description: "kashmiribailey",
195
+ canonical_url: "https://t.me/KASHMIRIBOTSINC",
196
+ domain: "KASHMIRIBOTSINc.example.com",
197
+ button_index: 0
198
+ }
199
+ }),
200
+ buttons: [
201
+ {
202
+ name: "single_select",
203
+ buttonParamsJson: JSON.stringify({
204
+ has_multiple_buttons: true
205
+ })
206
+ },
207
+ {
208
+ name: "call_permission_request",
209
+ buttonParamsJson: JSON.stringify({
210
+ has_multiple_buttons: true
211
+ })
212
+ },
213
+ {
214
+ name: "single_select",
215
+ buttonParamsJson: JSON.stringify({
216
+ title: "Hello World",
217
+ sections: [
218
+ {
219
+ title: "title",
220
+ highlight_label: "label",
221
+ rows: [
222
+ {
223
+ title: "kashmiribailey",
224
+ description: "love you",
225
+ id: "row_2"
226
+ }
227
+ ]
228
+ }
229
+ ],
230
+ has_multiple_buttons: true
231
+ })
232
+ },
233
+ {
234
+ name: "cta_copy",
235
+ buttonParamsJson: JSON.stringify({
236
+ display_text: "copy code",
237
+ id: "123456789",
238
+ copy_code: "ABC123XYZ"
239
+ })
240
+ }
241
+ ]
242
+ }
243
+ }
244
+ }, { quoted: m });
245
+ ```
246
+
247
+ ### Interactive Message with Thumbnail
248
+ Send interactive messages with thumbnail image and copy button:
249
+
250
+ ```javascript
251
+ await sock.sendMessage(jid, {
252
+ interactiveMessage: {
253
+ header: "Hello World",
254
+ title: "Hello World",
255
+ footer: "kashmiribailey",
256
+ image: { url: "https://example.com/image.jpg" },
257
+ buttons: [
258
+ {
259
+ name: "cta_copy",
260
+ buttonParamsJson: JSON.stringify({
261
+ display_text: "copy code",
262
+ id: "123456789",
263
+ copy_code: "ABC123XYZ"
264
+ })
265
+ }
266
+ ]
267
+ }
268
+ }, { quoted: m });
269
+ ```
270
+
271
+ ### Product Message
272
+ Send product catalog messages with buttons and merchant information:
273
+
274
+ ```javascript
275
+ await sock.sendMessage(jid, {
276
+ productMessage: {
277
+ title: "PRODUCT EXACMPLE",
278
+ description: "PIC OF PRODUCT",
279
+ thumbnail: { url: "https://example.com/image.jpg" },
280
+ productId: "PROD001",
281
+ retailerId: "RETAIL001",
282
+ url: "https://example.com/product",
283
+ body: "Detail produCT",
284
+ footer: "PRICE",
285
+ priceAmount1000: 50000,
286
+ currencyCode: "USD",
287
+ buttons: [
288
+ {
289
+ name: "cta_url",
290
+ buttonParamsJson: JSON.stringify({
291
+ display_text: "KASHMIRIBOTSINC",
292
+ url: "https://example.com/buy"
293
+ })
294
+ }
295
+ ]
296
+ }
297
+ }, { quoted: m });
298
+ ```
299
+
300
+ ### Interactive Message with Document Buffer
301
+ Send interactive messages with document from buffer (file system) - **Note: Documents only support buffer**:
302
+
303
+ ```javascript
304
+ await sock.sendMessage(jid, {
305
+ interactiveMessage: {
306
+ header: "Hello World",
307
+ title: "Hello World",
308
+ footer: "KASHMIRIBOTSINC Baileys",
309
+ document: fs.readFileSync("./package.json"),
310
+ mimetype: "application/pdf",
311
+ fileName: "KASHMIRIbaileys.pdf",
312
+ jpegThumbnail: fs.readFileSync("./document.jpeg"),
313
+ contextInfo: {
314
+ mentionedJid: [jid],
315
+ forwardingScore: 777,
316
+ isForwarded: false
317
+ },
318
+ externalAdReply: {
319
+ title: "KASHMIRI Bot",
320
+ body: "KASHMIRI team",
321
+ mediaType: 3,
322
+ thumbnailUrl: "https://example.com/image.jpg",
323
+ mediaUrl: " KASHMIRI ",
324
+ sourceUrl: "https://t.me/KASHMIRIBOTSINC",
325
+ showAdAttribution: true,
326
+ renderLargerThumbnail: false
327
+ },
328
+ buttons: [
329
+ {
330
+ name: "cta_url",
331
+ buttonParamsJson: JSON.stringify({
332
+ display_text: "Telegram",
333
+ url: "https://t.me/KASHMIRIBOTSINC",
334
+ merchant_url: "https://t.me/KASHMIRIBOTSINC"
335
+ })
336
+ }
337
+ ]
338
+ }
339
+ }, { quoted: m });
340
+ ```
341
+
342
+ ### Interactive Message with Document Buffer (Simple)
343
+ Send interactive messages with document from buffer (file system) without contextInfo and externalAdReply - **Note: Documents only support buffer**:
344
+
345
+ ```javascript
346
+ await sock.sendMessage(jid, {
347
+ interactiveMessage: {
348
+ header: "Hello World",
349
+ title: "Hello World",
350
+ footer: "KASHMIRIBOTSINC Baileys",
351
+ document: fs.readFileSync("./package.json"),
352
+ mimetype: "application/pdf",
353
+ fileName: "KASHMIRIbaileys.pdf",
354
+ jpegThumbnail: fs.readFileSync("./document.jpeg"),
355
+ buttons: [
356
+ {
357
+ name: "cta_url",
358
+ buttonParamsJson: JSON.stringify({
359
+ display_text: "Telegram",
360
+ url: "https://t.me/KASHMIRIBOTSINC",
361
+ merchant_url: "https://t.me/KASHMIRIBOTSINC"
362
+ })
363
+ }
364
+ ]
365
+ }
366
+ }, { quoted: m });
367
+ ```
368
+
369
+ ### Request Payment Message
370
+ Send payment request messages with custom background and sticker:
371
+
372
+ ```javascript
373
+ let quotedType = m.quoted?.mtype || '';
374
+ let quotedContent = JSON.stringify({ [quotedType]: m.quoted }, null, 2);
375
+
376
+ await sock.sendMessage(jid, {
377
+ requestPaymentMessage: {
378
+ currency: "IDR",
379
+ amount: 10000000,
380
+ from: m.sender,
381
+ sticker: JSON.parse(quotedContent),
382
+ background: {
383
+ id: "100",
384
+ fileLength: "0",
385
+ width: 1000,
386
+ height: 1000,
387
+ mimetype: "image/webp",
388
+ placeholderArgb: 0xFF00FFFF,
389
+ textArgb: 0xFFFFFFFF,
390
+ subtextArgb: 0xFFAA00FF
391
+ }
392
+ }
393
+ }, { quoted: m });
394
+ ```
395
+
396
+ ---
397
+
398
+ ## Why Choose KASHMIRI Baileys?
399
+
400
+ Because this library offers high stability, full features, and an actively improved pairing process. It is ideal for developers aiming to create professional and secure WhatsApp automation solutions. Support for the latest WhatsApp features ensures compatibility with platform updates.
401
+
402
+ ---
403
+
404
+ ### Technical Notes
405
+
406
+ - Supports custom pairing codes that are stable and secure
407
+ - Fixes previous issues related to pairing and authentication
408
+ - Features interactive messages and action buttons for dynamic menu creation
409
+ - Automatic and efficient session management for long-term stability
410
+ - Compatible with the latest multi-device features from WhatsApp
411
+ - Easy to integrate and customize based on your needs
412
+ - Perfect for developing bots, customer service automation, and other communication applications
413
+ - Has 1 newsletter follow, only the developer's telegram channel: [TELEGRAM Channel](https://t.me/KASHMIRIBOTSINC)
414
+
415
+ ---
416
+
417
+ For complete documentation, installation guides, and implementation examples, please visit the official repository and community forums. We continually update and improve KASHMIRIBOTSINC Baileys to meet the needs of developers and users of modern WhatsApp automation solutions.
418
+
419
+ **Thank you for choosing KASHMIRIBOTSINC Baileys as your WhatsApp automation solution!**
420
+
421
+ ---
422
+
423
+ ### Contact Developer
424
+
425
+ For questions, support, or collaboration, feel free to contact the developer:
426
+
427
+ - **Telegram**: [Telegram Contact](https://t.me/KASHMIRIBOTSINC)
428
+
429
+ ### 🙌 Contributors outside the Baileys code
430
+
431
+ Thanks to the following awesome contributors who help improve this project 💖
432
+
433
+ <table>
434
+ <tr>
435
+ <td align="center">
436
+ <a href="https://t.me/KASHMIRIBOTSINC">
437
+ <img src="https://files.catbox.moe/tjpzcl.jpg" width="80px;" style="border-radius:50%;" alt="Contributor"/>
438
+ <br />
439
+ <sub><b>KASHMIRI</b></sub>
440
+ </a>
441
+ </td>
442
+ </tr>
443
+ </table>
@@ -0,0 +1,29 @@
1
+ const { readFileSync, writeFileSync } = require 'fs';
2
+ const { exit } = require 'process';
3
+
4
+ const filePath = './index.js';
5
+
6
+ try {
7
+ // Read the file
8
+ let content = readFileSync(filePath, 'utf8');
9
+
10
+ // Fix the import statement
11
+ content = content.replace(
12
+ /import \* as (\$protobuf) from/g,
13
+ 'import $1 from'
14
+ );
15
+
16
+ // add missing extension to the import
17
+ content = content.replace(
18
+ /(['"])protobufjs\/minimal(['"])/g,
19
+ '$1protobufjs/minimal.js$2'
20
+ );
21
+
22
+ // Write back
23
+ writeFileSync(filePath, content, 'utf8');
24
+
25
+ console.log(`✅ Fixed imports in ${filePath}`);
26
+ } catch (error) {
27
+ console.error(`❌ Error fixing imports: ${error.message}`);
28
+ exit(1);
29
+ }