@exclipz/baileys 10.0.1

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 (194) hide show
  1. package/README.md +365 -0
  2. package/WAProto/fix-import.js +29 -0
  3. package/WAProto/index.js +97650 -0
  4. package/engine-requirements.js +10 -0
  5. package/lib/Defaults/baileys-version.json +3 -0
  6. package/lib/Defaults/index.d.ts +53 -0
  7. package/lib/Defaults/index.js +147 -0
  8. package/lib/Defaults/phonenumber-mcc.json +223 -0
  9. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  10. package/lib/Signal/Group/ciphertext-message.js +15 -0
  11. package/lib/Signal/Group/group-session-builder.d.ts +14 -0
  12. package/lib/Signal/Group/group-session-builder.js +64 -0
  13. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  14. package/lib/Signal/Group/group_cipher.js +96 -0
  15. package/lib/Signal/Group/index.d.ts +11 -0
  16. package/lib/Signal/Group/index.js +57 -0
  17. package/lib/Signal/Group/keyhelper.d.ts +10 -0
  18. package/lib/Signal/Group/keyhelper.js +55 -0
  19. package/lib/Signal/Group/queue-job.d.ts +1 -0
  20. package/lib/Signal/Group/queue-job.js +57 -0
  21. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  22. package/lib/Signal/Group/sender-chain-key.js +34 -0
  23. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  24. package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
  25. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  26. package/lib/Signal/Group/sender-key-message.js +69 -0
  27. package/lib/Signal/Group/sender-key-name.d.ts +17 -0
  28. package/lib/Signal/Group/sender-key-name.js +51 -0
  29. package/lib/Signal/Group/sender-key-record.d.ts +30 -0
  30. package/lib/Signal/Group/sender-key-record.js +53 -0
  31. package/lib/Signal/Group/sender-key-state.d.ts +38 -0
  32. package/lib/Signal/Group/sender-key-state.js +99 -0
  33. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  34. package/lib/Signal/Group/sender-message-key.js +29 -0
  35. package/lib/Signal/libsignal.d.ts +3 -0
  36. package/lib/Signal/libsignal.js +174 -0
  37. package/lib/Socket/Client/abstract-socket-client.d.ts +17 -0
  38. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  39. package/lib/Socket/Client/index.d.ts +3 -0
  40. package/lib/Socket/Client/index.js +19 -0
  41. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  42. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  43. package/lib/Socket/Client/web-socket-client.d.ts +12 -0
  44. package/lib/Socket/Client/web-socket-client.js +62 -0
  45. package/lib/Socket/business.d.ts +171 -0
  46. package/lib/Socket/business.js +260 -0
  47. package/lib/Socket/chats.d.ts +267 -0
  48. package/lib/Socket/chats.js +970 -0
  49. package/lib/Socket/groups.d.ts +115 -0
  50. package/lib/Socket/groups.js +381 -0
  51. package/lib/Socket/index.d.ts +173 -0
  52. package/lib/Socket/index.js +11 -0
  53. package/lib/Socket/luxu.d.ts +278 -0
  54. package/lib/Socket/luxu.js +620 -0
  55. package/lib/Socket/messages-recv.d.ts +161 -0
  56. package/lib/Socket/messages-recv.js +1110 -0
  57. package/lib/Socket/messages-send.d.ts +149 -0
  58. package/lib/Socket/messages-send.js +916 -0
  59. package/lib/Socket/newsletter.d.ts +134 -0
  60. package/lib/Socket/newsletter.js +317 -0
  61. package/lib/Socket/registration.d.ts +267 -0
  62. package/lib/Socket/registration.js +166 -0
  63. package/lib/Socket/socket.d.ts +44 -0
  64. package/lib/Socket/socket.js +736 -0
  65. package/lib/Socket/usync.d.ts +36 -0
  66. package/lib/Socket/usync.js +70 -0
  67. package/lib/Store/index.d.ts +3 -0
  68. package/lib/Store/index.js +10 -0
  69. package/lib/Store/make-cache-manager-store.d.ts +13 -0
  70. package/lib/Store/make-cache-manager-store.js +83 -0
  71. package/lib/Store/make-in-memory-store.d.ts +118 -0
  72. package/lib/Store/make-in-memory-store.js +427 -0
  73. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  74. package/lib/Store/make-ordered-dictionary.js +81 -0
  75. package/lib/Store/object-repository.d.ts +10 -0
  76. package/lib/Store/object-repository.js +27 -0
  77. package/lib/Types/Auth.d.ts +110 -0
  78. package/lib/Types/Auth.js +2 -0
  79. package/lib/Types/Call.d.ts +13 -0
  80. package/lib/Types/Call.js +2 -0
  81. package/lib/Types/Chat.d.ts +102 -0
  82. package/lib/Types/Chat.js +4 -0
  83. package/lib/Types/Contact.d.ts +19 -0
  84. package/lib/Types/Contact.js +2 -0
  85. package/lib/Types/Events.d.ts +157 -0
  86. package/lib/Types/Events.js +2 -0
  87. package/lib/Types/GroupMetadata.d.ts +55 -0
  88. package/lib/Types/GroupMetadata.js +2 -0
  89. package/lib/Types/Label.d.ts +35 -0
  90. package/lib/Types/Label.js +27 -0
  91. package/lib/Types/LabelAssociation.d.ts +29 -0
  92. package/lib/Types/LabelAssociation.js +9 -0
  93. package/lib/Types/Message.d.ts +273 -0
  94. package/lib/Types/Message.js +9 -0
  95. package/lib/Types/Newsletter.d.ts +103 -0
  96. package/lib/Types/Newsletter.js +38 -0
  97. package/lib/Types/Product.d.ts +78 -0
  98. package/lib/Types/Product.js +2 -0
  99. package/lib/Types/Signal.d.ts +57 -0
  100. package/lib/Types/Signal.js +2 -0
  101. package/lib/Types/Socket.d.ts +111 -0
  102. package/lib/Types/Socket.js +2 -0
  103. package/lib/Types/State.d.ts +27 -0
  104. package/lib/Types/State.js +2 -0
  105. package/lib/Types/USync.d.ts +25 -0
  106. package/lib/Types/USync.js +2 -0
  107. package/lib/Types/index.d.ts +57 -0
  108. package/lib/Types/index.js +42 -0
  109. package/lib/Utils/auth-utils.d.ts +18 -0
  110. package/lib/Utils/auth-utils.js +206 -0
  111. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  112. package/lib/Utils/baileys-event-stream.js +63 -0
  113. package/lib/Utils/business.d.ts +22 -0
  114. package/lib/Utils/business.js +234 -0
  115. package/lib/Utils/chat-utils.d.ts +71 -0
  116. package/lib/Utils/chat-utils.js +729 -0
  117. package/lib/Utils/crypto.d.ts +41 -0
  118. package/lib/Utils/crypto.js +151 -0
  119. package/lib/Utils/decode-wa-message.d.ts +19 -0
  120. package/lib/Utils/decode-wa-message.js +198 -0
  121. package/lib/Utils/event-buffer.d.ts +35 -0
  122. package/lib/Utils/event-buffer.js +514 -0
  123. package/lib/Utils/generics.d.ts +92 -0
  124. package/lib/Utils/generics.js +423 -0
  125. package/lib/Utils/history.d.ts +15 -0
  126. package/lib/Utils/history.js +96 -0
  127. package/lib/Utils/index.d.ts +17 -0
  128. package/lib/Utils/index.js +33 -0
  129. package/lib/Utils/link-preview.d.ts +21 -0
  130. package/lib/Utils/link-preview.js +93 -0
  131. package/lib/Utils/logger.d.ts +4 -0
  132. package/lib/Utils/logger.js +7 -0
  133. package/lib/Utils/lt-hash.d.ts +12 -0
  134. package/lib/Utils/lt-hash.js +51 -0
  135. package/lib/Utils/make-mutex.d.ts +7 -0
  136. package/lib/Utils/make-mutex.js +43 -0
  137. package/lib/Utils/messages-media.d.ts +116 -0
  138. package/lib/Utils/messages-media.js +819 -0
  139. package/lib/Utils/messages.d.ts +77 -0
  140. package/lib/Utils/messages.js +816 -0
  141. package/lib/Utils/noise-handler.d.ts +21 -0
  142. package/lib/Utils/noise-handler.js +155 -0
  143. package/lib/Utils/process-message.d.ts +41 -0
  144. package/lib/Utils/process-message.js +321 -0
  145. package/lib/Utils/signal.d.ts +32 -0
  146. package/lib/Utils/signal.js +153 -0
  147. package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
  148. package/lib/Utils/use-multi-file-auth-state.js +119 -0
  149. package/lib/Utils/validate-connection.d.ts +11 -0
  150. package/lib/Utils/validate-connection.js +229 -0
  151. package/lib/WABinary/constants.d.ts +30 -0
  152. package/lib/WABinary/constants.js +40 -0
  153. package/lib/WABinary/decode.d.ts +7 -0
  154. package/lib/WABinary/decode.js +252 -0
  155. package/lib/WABinary/encode.d.ts +3 -0
  156. package/lib/WABinary/encode.js +265 -0
  157. package/lib/WABinary/generic-utils.d.ts +17 -0
  158. package/lib/WABinary/generic-utils.js +198 -0
  159. package/lib/WABinary/index.d.ts +5 -0
  160. package/lib/WABinary/index.js +21 -0
  161. package/lib/WABinary/jid-utils.d.ts +31 -0
  162. package/lib/WABinary/jid-utils.js +62 -0
  163. package/lib/WABinary/types.d.ts +18 -0
  164. package/lib/WABinary/types.js +2 -0
  165. package/lib/WAM/BinaryInfo.d.ts +17 -0
  166. package/lib/WAM/BinaryInfo.js +13 -0
  167. package/lib/WAM/constants.d.ts +38 -0
  168. package/lib/WAM/constants.js +15350 -0
  169. package/lib/WAM/encode.d.ts +3 -0
  170. package/lib/WAM/encode.js +155 -0
  171. package/lib/WAM/index.d.ts +3 -0
  172. package/lib/WAM/index.js +19 -0
  173. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  174. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  175. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  176. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  177. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  178. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  179. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  180. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  181. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
  182. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
  183. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
  184. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
  185. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  186. package/lib/WAUSync/Protocols/index.js +20 -0
  187. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  188. package/lib/WAUSync/USyncQuery.js +89 -0
  189. package/lib/WAUSync/USyncUser.d.ts +12 -0
  190. package/lib/WAUSync/USyncUser.js +26 -0
  191. package/lib/WAUSync/index.js +19 -0
  192. package/lib/index.d.ts +12 -0
  193. package/lib/index.js +39 -0
  194. package/package.json +100 -0
package/README.md ADDED
@@ -0,0 +1,365 @@
1
+ # WhatsApp Baileys
2
+
3
+ <p align="center">
4
+ <img src="https://github.com/excl1pz/Screaper/blob/main/exclipzpict.png" alt="Thumbnail" />
5
+ </p>
6
+
7
+ # @exclipz/baileys
8
+
9
+ <p>
10
+ <img src="https://img.shields.io/badge/Node.js-339933?style=for-the-badge&logo=nodedotjs&logoColor=white" />
11
+ <img src="https://img.shields.io/badge/WhatsApp-25D366?style=for-the-badge&logo=whatsapp&logoColor=white" />
12
+ <img src="https://img.shields.io/badge/WebSocket-010101?style=for-the-badge&logo=socketdotio&logoColor=white" />
13
+ <img src="https://img.shields.io/badge/Open%20Source-FF4500?style=for-the-badge&logo=github&logoColor=white" />
14
+ <img src="https://img.shields.io/badge/license-MIT-blue?style=for-the-badge" />
15
+ </p>
16
+
17
+ ### Main Features and Advantages
18
+
19
+ - Supports automatic and custom pairing processes
20
+ - Fixes previous pairing issues that often caused failures or disconnections
21
+ - Supports interactive messages, action buttons, and dynamic menus
22
+ - Efficient automatic session management for reliable operation
23
+ - Compatible with the latest multi-device features from WhatsApp
24
+ - Lightweight, stable, and easy to integrate into various systems
25
+ - Suitable for developing bots, automation, and complete communication solutions
26
+ - Comprehensive documentation and example codes to facilitate development
27
+
28
+ ---
29
+
30
+ ## Getting Started
31
+
32
+ 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.
33
+
34
+ ---
35
+
36
+ ## SendMessage Documentation
37
+
38
+ ### Album Message (Multiple Images)
39
+ Send multiple images in a single album message:
40
+
41
+ ```javascript
42
+ await sock.sendMessage(jid, {
43
+ albumMessage: [
44
+ { image: cihuy, caption: "Foto pertama" },
45
+ { image: { url: "URL IMAGE" }, caption: "Foto kedua" }
46
+ ]
47
+ }, { quoted: m });
48
+ ```
49
+
50
+ ### Event Message
51
+ Create and send WhatsApp event invitations:
52
+
53
+ ```javascript
54
+ await sock.sendMessage(jid, {
55
+ eventMessage: {
56
+ isCanceled: false,
57
+ name: "Hello World",
58
+ description: "ShinVoc Exclipz",
59
+ location: {
60
+ degreesLatitude: 0,
61
+ degreesLongitude: 0,
62
+ name: "ShinVoc"
63
+ },
64
+ joinLink: "https://call.whatsapp.com/video/ShinVoc",
65
+ startTime: "1763019000",
66
+ endTime: "1763026200",
67
+ extraGuestsAllowed: false
68
+ }
69
+ }, { quoted: m });
70
+ ```
71
+
72
+ ### Poll Result Message
73
+ Display poll results with vote counts:
74
+
75
+ ```javascript
76
+ await sock.sendMessage(jid, {
77
+ pollResultMessage: {
78
+ name: "Hello World",
79
+ pollVotes: [
80
+ {
81
+ optionName: "TEST 1",
82
+ optionVoteCount: "112233"
83
+ },
84
+ {
85
+ optionName: "TEST 2",
86
+ optionVoteCount: "1"
87
+ }
88
+ ]
89
+ }
90
+ }, { quoted: m });
91
+ ```
92
+
93
+ ### Simple Interactive Message
94
+ Send basic interactive messages with copy button functionality:
95
+
96
+ ```javascript
97
+ await sock.sendMessage(jid, {
98
+ interactiveMessage: {
99
+ header: "Hello World",
100
+ title: "Hello World",
101
+ footer: "telegram: @ShinVoc",
102
+ buttons: [
103
+ {
104
+ name: "cta_copy",
105
+ buttonParamsJson: JSON.stringify({
106
+ display_text: "copy code",
107
+ id: "123456789",
108
+ copy_code: "ABC123XYZ"
109
+ })
110
+ }
111
+ ]
112
+ }
113
+ }, { quoted: m });
114
+ ```
115
+
116
+ ### Interactive Message with Native Flow
117
+ Send interactive messages with buttons, copy actions, and native flow features:
118
+
119
+ ```javascript
120
+ await sock.sendMessage(jid, {
121
+ interactiveMessage: {
122
+ header: "Hello World",
123
+ title: "Hello World",
124
+ footer: "telegram: @ShinVoc",
125
+ image: { url: "https://example.com/image.jpg" },
126
+ nativeFlowMessage: {
127
+ messageParamsJson: JSON.stringify({
128
+ limited_time_offer: {
129
+ text: "idk hummmm?",
130
+ url: "https://t.me/ShinVoc"
131
+ copy_code: "ShinVoc",
132
+ expiration_time: Date.now() * 999
133
+ },
134
+ bottom_sheet: {
135
+ in_thread_buttons_limit: 2,
136
+ divider_indices: [1, 2, 3, 4, 5, 999],
137
+ list_title: "ShinVoc Native",
138
+ button_title: "ShinVoc Native"
139
+ },
140
+ tap_target_configuration: {
141
+ title: " X ",
142
+ description: "bomboclard",
143
+ canonical_url: "https://t.me/ShinVoc",
144
+ domain: "shop.example.com",
145
+ button_index: 0
146
+ }
147
+ }),
148
+ buttons: [
149
+ {
150
+ name: "single_select", buttonParamsJson: JSON.stringify({
151
+ has_multiple_buttons: true
152
+ })
153
+ },
154
+ {
155
+ name: "call_permission_request",
156
+ buttonParamsJson: JSON.stringify({
157
+ has_multiple_buttons: true
158
+ })
159
+ },
160
+ {
161
+ name: "single_select",
162
+ buttonParamsJson: JSON.stringify({
163
+ title: "Hello World",
164
+ sections: [
165
+ {
166
+ title: "title",
167
+ highlight_label: "label",
168
+ rows: [
169
+ {
170
+ title: "@ShinVoc",
171
+ description: "love you",
172
+ id: "row_2"
173
+ }
174
+ ]
175
+ }
176
+ ],
177
+ has_multiple_buttons: true
178
+ })
179
+ },
180
+ {
181
+ name: "cta_copy",
182
+ buttonParamsJson: JSON.stringify({
183
+ display_text: "copy code",
184
+ id: "123456789",
185
+ copy_code: "ABC123XYZ"
186
+ })
187
+ }
188
+ ]
189
+ }
190
+ }
191
+ }, { quoted: m });
192
+ ```
193
+
194
+ ### Interactive Message with Thumbnail
195
+ Send interactive messages with thumbnail image and copy button:
196
+
197
+ ```javascript
198
+ await sock.sendMessage(jid, {
199
+ interactiveMessage: {
200
+ header: "Hello World",
201
+ title: "Hello World",
202
+ footer: "telegram: @ShinVoc",
203
+ image: { url: "https://example.com/image.jpg" },
204
+ buttons: [
205
+ {
206
+ name: "cta_copy",
207
+ buttonParamsJson: JSON.stringify({
208
+ display_text: "copy code",
209
+ id: "123456789",
210
+ copy_code: "ABC123XYZ"
211
+ })
212
+ }
213
+ ]
214
+ }
215
+ }, { quoted: m });
216
+ ```
217
+
218
+ ### Product Message
219
+ Send product catalog messages with buttons and merchant information:
220
+
221
+ ```javascript
222
+ await sock.sendMessage(jid, {
223
+ productMessage: {
224
+ title: "Produk Contoh",
225
+ description: "Ini adalah deskripsi produk",
226
+ thumbnail: { url: "https://example.com/image.jpg" },
227
+ productId: "PROD001",
228
+ retailerId: "RETAIL001",
229
+ url: "https://example.com/product",
230
+ body: "Detail produk",
231
+ footer: "Harga spesial",
232
+ priceAmount1000: 50000,
233
+ currencyCode: "USD",
234
+ buttons: [
235
+ {
236
+ name: "cta_url",
237
+ buttonParamsJson: JSON.stringify({
238
+ display_text: "Beli Sekarang",
239
+ url: "https://example.com/buy"
240
+ })
241
+ }
242
+ ]
243
+ }
244
+ }, { quoted: m });
245
+ ```
246
+
247
+ ### Interactive Message with Document Buffer
248
+ Send interactive messages with document from buffer (file system) - **Note: Documents only support buffer**:
249
+
250
+ ```javascript
251
+ await sock.sendMessage(jid, {
252
+ interactiveMessage: {
253
+ header: "Hello World",
254
+ title: "Hello World",
255
+ footer: "telegram: @ShinVoc",
256
+ document: fs.readFileSync("./package.json"),
257
+ mimetype: "application/pdf",
258
+ fileName: "ShinVoc.pdf",
259
+ jpegThumbnail: fs.readFileSync("./document.jpeg"),
260
+ contextInfo: {
261
+ mentionedJid: [jid],
262
+ forwardingScore: 777,
263
+ isForwarded: false
264
+ },
265
+ externalAdReply: {
266
+ title: "shenń Bot",
267
+ body: "anu team",
268
+ mediaType: 3,
269
+ thumbnailUrl: "https://example.com/image.jpg",
270
+ mediaUrl: " X ",
271
+ sourceUrl: "https://t.me/ShinVoc",
272
+ showAdAttribution: true,
273
+ renderLargerThumbnail: false
274
+ },
275
+ buttons: [
276
+ {
277
+ name: "cta_url",
278
+ buttonParamsJson: JSON.stringify({
279
+ display_text: "Telegram",
280
+ url: "https://t.me/ShinVoc",
281
+ merchant_url: "https://t.me/ShinVoc"
282
+ })
283
+ }
284
+ ]
285
+ }
286
+ }, { quoted: m });
287
+ ```
288
+
289
+ ### Interactive Message with Document Buffer (Simple)
290
+ Send interactive messages with document from buffer (file system) without contextInfo and externalAdReply - **Note: Documents only support buffer**:
291
+
292
+ ```javascript
293
+ await sock.sendMessage(jid, {
294
+ interactiveMessage: {
295
+ header: "Hello World",
296
+ title: "Hello World",
297
+ footer: "telegram: @ShinVoc",
298
+ document: fs.readFileSync("./package.json"),
299
+ mimetype: "application/pdf",
300
+ fileName: "ShinVoc.pdf",
301
+ jpegThumbnail: fs.readFileSync("./document.jpeg"),
302
+ buttons: [
303
+ {
304
+ name: "cta_url",
305
+ buttonParamsJson: JSON.stringify({
306
+ display_text: "Telegram",
307
+ url: "https://t.me/ShinVoc",
308
+ merchant_url: "https://t.me/ShinVoc"
309
+ })
310
+ }
311
+ ]
312
+ }
313
+ }, { quoted: m });
314
+ ```
315
+
316
+ ### Request Payment Message
317
+ Send payment request messages with custom background and sticker:
318
+
319
+ ```javascript
320
+ let quotedType = m.quoted?.mtype || '';
321
+ let quotedContent = JSON.stringify({ [quotedType]: m.quoted }, null, 2);
322
+
323
+ await sock.sendMessage(jid, {
324
+ requestPaymentMessage: {
325
+ currency: "IDR",
326
+ amount: 10000000,
327
+ from: m.sender,
328
+ sticker: JSON.parse(quotedContent),
329
+ background: {
330
+ id: "100",
331
+ fileLength: "0",
332
+ width: 1000,
333
+ height: 1000,
334
+ mimetype: "image/webp",
335
+ placeholderArgb: 0xFF00FFFF,
336
+ textArgb: 0xFFFFFFFF,
337
+ subtextArgb: 0xFFAA00FF
338
+ }
339
+ }
340
+ }, { quoted: m });
341
+ ```
342
+
343
+ ---
344
+
345
+ ## Why Choose WhatsApp Baileys?
346
+
347
+ 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.
348
+
349
+ ---
350
+
351
+ ### Technical Notes
352
+
353
+ - Supports custom pairing codes that are stable and secure
354
+ - Fixes previous issues related to pairing and authentication
355
+ - Features interactive messages and action buttons for dynamic menu creation
356
+ - Automatic and efficient session management for long-term stability
357
+ - Compatible with the latest multi-device features from WhatsApp
358
+ - Easy to integrate and customize based on your needs
359
+ - Perfect for developing bots, customer service automation, and other communication applications
360
+
361
+ ---
362
+
363
+ For complete documentation, installation guides, and implementation examples, please visit the official repository and community forums. We continually update and improve this library to meet the needs of developers and users of modern WhatsApp automation solutions.
364
+
365
+ **Thank you for choosing WhatsApp Baileys as your WhatsApp automation solution!**
@@ -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
+ }