@queenanya/baileys 8.1.5 → 8.2.5-beta

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 (178) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +459 -0
  3. package/WAProto/index.d.ts +53473 -0
  4. package/WAProto/index.js +165029 -0
  5. package/WASignalGroup/GroupProtocol.js +1697 -0
  6. package/WASignalGroup/ciphertext_message.js +16 -0
  7. package/WASignalGroup/group_cipher.js +120 -0
  8. package/WASignalGroup/group_session_builder.js +46 -0
  9. package/WASignalGroup/index.js +5 -0
  10. package/WASignalGroup/keyhelper.js +21 -0
  11. package/WASignalGroup/protobufs.js +3 -0
  12. package/WASignalGroup/queue_job.js +69 -0
  13. package/WASignalGroup/sender_chain_key.js +50 -0
  14. package/WASignalGroup/sender_key_distribution_message.js +78 -0
  15. package/WASignalGroup/sender_key_message.js +92 -0
  16. package/WASignalGroup/sender_key_name.js +70 -0
  17. package/WASignalGroup/sender_key_record.js +56 -0
  18. package/WASignalGroup/sender_key_state.js +129 -0
  19. package/WASignalGroup/sender_message_key.js +39 -0
  20. package/engine-requirements.js +10 -0
  21. package/lib/Defaults/baileys-version.json +3 -0
  22. package/lib/Defaults/index.d.ts +51 -0
  23. package/lib/Defaults/index.js +107 -0
  24. package/lib/Signal/libsignal.d.ts +3 -0
  25. package/lib/Signal/libsignal.js +161 -0
  26. package/lib/Socket/Client/index.d.ts +2 -0
  27. package/lib/Socket/Client/index.js +18 -0
  28. package/lib/Socket/Client/types.d.ts +15 -0
  29. package/lib/Socket/Client/types.js +13 -0
  30. package/lib/Socket/Client/websocket.d.ts +12 -0
  31. package/lib/Socket/Client/websocket.js +62 -0
  32. package/lib/Socket/business.d.ts +177 -0
  33. package/lib/Socket/business.js +260 -0
  34. package/lib/Socket/chats.d.ts +89 -0
  35. package/lib/Socket/chats.js +954 -0
  36. package/lib/Socket/groups.d.ts +128 -0
  37. package/lib/Socket/groups.js +328 -0
  38. package/lib/Socket/index.d.ts +177 -0
  39. package/lib/Socket/index.js +10 -0
  40. package/lib/Socket/messages-recv.d.ts +166 -0
  41. package/lib/Socket/messages-recv.js +1056 -0
  42. package/lib/Socket/messages-send.d.ts +156 -0
  43. package/lib/Socket/messages-send.js +836 -0
  44. package/lib/Socket/newsletter.d.ts +140 -0
  45. package/lib/Socket/newsletter.js +252 -0
  46. package/lib/Socket/socket.d.ts +43 -0
  47. package/lib/Socket/socket.js +635 -0
  48. package/lib/Socket/usync.d.ts +36 -0
  49. package/lib/Socket/usync.js +65 -0
  50. package/lib/Store/index.d.ts +2 -0
  51. package/lib/Store/index.js +8 -0
  52. package/lib/Store/make-cache-manager-store.d.ts +14 -0
  53. package/lib/Store/make-cache-manager-store.js +83 -0
  54. package/lib/Store/make-in-memory-store.d.ts +118 -0
  55. package/lib/Store/make-in-memory-store.js +429 -0
  56. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  57. package/lib/Store/make-ordered-dictionary.js +81 -0
  58. package/lib/Store/object-repository.d.ts +10 -0
  59. package/lib/Store/object-repository.js +27 -0
  60. package/lib/Types/Auth.d.ts +103 -0
  61. package/lib/Types/Auth.js +2 -0
  62. package/lib/Types/Call.d.ts +13 -0
  63. package/lib/Types/Call.js +2 -0
  64. package/lib/Types/Chat.d.ts +115 -0
  65. package/lib/Types/Chat.js +4 -0
  66. package/lib/Types/Contact.d.ts +24 -0
  67. package/lib/Types/Contact.js +2 -0
  68. package/lib/Types/Events.d.ts +199 -0
  69. package/lib/Types/Events.js +2 -0
  70. package/lib/Types/GroupMetadata.d.ts +63 -0
  71. package/lib/Types/GroupMetadata.js +2 -0
  72. package/lib/Types/Label.d.ts +46 -0
  73. package/lib/Types/Label.js +27 -0
  74. package/lib/Types/LabelAssociation.d.ts +29 -0
  75. package/lib/Types/LabelAssociation.js +9 -0
  76. package/lib/Types/Message.d.ts +384 -0
  77. package/lib/Types/Message.js +7 -0
  78. package/lib/Types/Newsletter.d.ts +79 -0
  79. package/lib/Types/Newsletter.js +18 -0
  80. package/lib/Types/Product.d.ts +78 -0
  81. package/lib/Types/Product.js +2 -0
  82. package/lib/Types/Signal.d.ts +57 -0
  83. package/lib/Types/Signal.js +2 -0
  84. package/lib/Types/Socket.d.ts +121 -0
  85. package/lib/Types/Socket.js +2 -0
  86. package/lib/Types/State.d.ts +27 -0
  87. package/lib/Types/State.js +2 -0
  88. package/lib/Types/USync.d.ts +25 -0
  89. package/lib/Types/USync.js +2 -0
  90. package/lib/Types/index.d.ts +64 -0
  91. package/lib/Types/index.js +42 -0
  92. package/lib/Utils/auth-utils.d.ts +18 -0
  93. package/lib/Utils/auth-utils.js +199 -0
  94. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  95. package/lib/Utils/baileys-event-stream.js +63 -0
  96. package/lib/Utils/business.d.ts +22 -0
  97. package/lib/Utils/business.js +234 -0
  98. package/lib/Utils/chat-utils.d.ts +70 -0
  99. package/lib/Utils/chat-utils.js +756 -0
  100. package/lib/Utils/crypto.d.ts +40 -0
  101. package/lib/Utils/crypto.js +195 -0
  102. package/lib/Utils/decode-wa-message.d.ts +38 -0
  103. package/lib/Utils/decode-wa-message.js +347 -0
  104. package/lib/Utils/event-buffer.d.ts +35 -0
  105. package/lib/Utils/event-buffer.js +518 -0
  106. package/lib/Utils/generics.d.ts +120 -0
  107. package/lib/Utils/generics.js +499 -0
  108. package/lib/Utils/history.d.ts +19 -0
  109. package/lib/Utils/history.js +94 -0
  110. package/lib/Utils/index.d.ts +17 -0
  111. package/lib/Utils/index.js +33 -0
  112. package/lib/Utils/link-preview.d.ts +21 -0
  113. package/lib/Utils/link-preview.js +126 -0
  114. package/lib/Utils/logger.d.ts +11 -0
  115. package/lib/Utils/logger.js +7 -0
  116. package/lib/Utils/lt-hash.d.ts +12 -0
  117. package/lib/Utils/lt-hash.js +51 -0
  118. package/lib/Utils/make-mutex.d.ts +7 -0
  119. package/lib/Utils/make-mutex.js +43 -0
  120. package/lib/Utils/messages-media.d.ts +127 -0
  121. package/lib/Utils/messages-media.js +792 -0
  122. package/lib/Utils/messages.d.ts +75 -0
  123. package/lib/Utils/messages.js +1020 -0
  124. package/lib/Utils/noise-handler.d.ts +19 -0
  125. package/lib/Utils/noise-handler.js +150 -0
  126. package/lib/Utils/process-message.d.ts +42 -0
  127. package/lib/Utils/process-message.js +372 -0
  128. package/lib/Utils/signal.d.ts +33 -0
  129. package/lib/Utils/signal.js +153 -0
  130. package/lib/Utils/use-multi-file-auth-state.d.ts +12 -0
  131. package/lib/Utils/use-multi-file-auth-state.js +125 -0
  132. package/lib/Utils/validate-connection.d.ts +10 -0
  133. package/lib/Utils/validate-connection.js +173 -0
  134. package/lib/WABinary/constants.d.ts +27 -0
  135. package/lib/WABinary/constants.js +40 -0
  136. package/lib/WABinary/decode.d.ts +6 -0
  137. package/lib/WABinary/decode.js +265 -0
  138. package/lib/WABinary/encode.d.ts +2 -0
  139. package/lib/WABinary/encode.js +252 -0
  140. package/lib/WABinary/generic-utils.d.ts +14 -0
  141. package/lib/WABinary/generic-utils.js +110 -0
  142. package/lib/WABinary/index.d.ts +5 -0
  143. package/lib/WABinary/index.js +21 -0
  144. package/lib/WABinary/jid-utils.d.ts +36 -0
  145. package/lib/WABinary/jid-utils.js +83 -0
  146. package/lib/WABinary/types.d.ts +18 -0
  147. package/lib/WABinary/types.js +2 -0
  148. package/lib/WAM/BinaryInfo.d.ts +8 -0
  149. package/lib/WAM/BinaryInfo.js +13 -0
  150. package/lib/WAM/constants.d.ts +39 -0
  151. package/lib/WAM/constants.js +15350 -0
  152. package/lib/WAM/encode.d.ts +2 -0
  153. package/lib/WAM/encode.js +155 -0
  154. package/lib/WAM/index.d.ts +3 -0
  155. package/lib/WAM/index.js +19 -0
  156. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  157. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  158. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  159. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  160. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  161. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  162. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  163. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  164. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
  165. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
  166. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
  167. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
  168. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  169. package/lib/WAUSync/Protocols/index.js +20 -0
  170. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  171. package/lib/WAUSync/USyncQuery.js +93 -0
  172. package/lib/WAUSync/USyncUser.d.ts +12 -0
  173. package/lib/WAUSync/USyncUser.js +26 -0
  174. package/lib/WAUSync/index.d.ts +3 -0
  175. package/lib/WAUSync/index.js +19 -0
  176. package/lib/index.d.ts +13 -0
  177. package/lib/index.js +33 -0
  178. package/package.json +101 -22
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Rajeh Taher/WhiskeySockets
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,459 @@
1
+ # 🚀 BAILEYS-ANYA
2
+ <div align="center">
3
+
4
+ <img src="https://raw.githubusercontent.com/teamolduser/database/refs/heads/main/image/anya.png" width="350px">
5
+
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;">🔥 Ultimate WhatsApp Web API Experience 🥵</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>
17
+
18
+ <br>
19
+
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>
23
+
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>
28
+
29
+ ---
30
+
31
+ ## 🔮 | WHY BAILEYS-ANYA?
32
+
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>
47
+
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;">
57
+
58
+ ### 📂 In package.json:
59
+ ```json
60
+ "dependencies": {
61
+ "baileys-anya": "*"
62
+ }
63
+ ```
64
+
65
+ ### ⚙️ Terminal Installation:
66
+ ```bash
67
+ npm install baileys-anya
68
+ ```
69
+ or
70
+ ```bash
71
+ yarn add baileys-anya
72
+ ```
73
+ or
74
+ ```bash
75
+ pnpm add baileys-anya
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 'baileys-anya'
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 {
92
+ default: makeWASocket
93
+ } = require("baileys-anya")
94
+ ```
95
+ </div>
96
+ </div>
97
+ </div>
98
+
99
+ <div align="center">
100
+ <img src="https://capsule-render.vercel.app/api?type=rect&color=gradient&height=2&section=header" width="100%">
101
+ </div>
102
+
103
+ ## ✨ | FEATURE SHOWCASE
104
+
105
+ <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;">
106
+
107
+ ### 🎀 Enhanced Features Matrix
108
+
109
+ | Feature | Description | Status |
110
+ |---------|-------------|--------|
111
+ | 🔊 **Channel Messaging** | Send & manage WhatsApp channel content | ✅ |
112
+ | 🎛️ **Interactive Messages** | Create rich button-based experiences | ✅ |
113
+ | 🤖 **AI Message Icon** | Brand your bot messages with AI icon | ✅ |
114
+ | 🖼️ **Enhanced Media** | Uncropped profile pictures & optimized media | ✅ |
115
+ | 🔐 **Custom Pairing** | Personalized device pairing codes | ✅ |
116
+ | 🔧 **Performance Optimizations** | Cleaner logs & improved signal handling | ✅ |
117
+ | 📱 **Cross-Platform** | Works on all NodeJS supported platforms | ✅ |
118
+
119
+ </div>
120
+
121
+ <br>
122
+
123
+ <div style="display: flex; justify-content: center; margin: 30px 0;">
124
+ <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>
125
+ </div>
126
+
127
+ ## 📰 | NEWSLETTER MANAGEMENT
128
+
129
+ <details>
130
+ <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>
131
+
132
+ <div style="padding: 15px; background: rgba(79, 70, 229, 0.05); border-radius: 0 0 10px 10px; margin-top: -5px;">
133
+
134
+ ### 📊 Get Newsletter Info
135
+ ```typescript
136
+ // By invite
137
+ const metadata = await sock.newsletterMetadata("invite", "xxxxx")
138
+ // By JID
139
+ const metadata = await sock.newsletterMetadata("jid", "abcd@newsletter")
140
+ console.log(metadata)
141
+ ```
142
+
143
+ ### 📝 Update Newsletter Content
144
+ ```typescript
145
+ // Update description
146
+ await sock.newsletterUpdateDescription("abcd@newsletter", "New Description")
147
+
148
+ // Update name
149
+ await sock.newsletterUpdateName("abcd@newsletter", "New Name")
150
+
151
+ // Update picture
152
+ await sock.newsletterUpdatePicture("abcd@newsletter", buffer)
153
+
154
+ // Remove picture
155
+ await sock.newsletterRemovePicture("abcd@newsletter")
156
+ ```
157
+
158
+ ### 🔔 Notification Management
159
+ ```typescript
160
+ // Unmute newsletter
161
+ await sock.newsletterUnmute("abcd@newsletter")
162
+
163
+ // Mute newsletter
164
+ await sock.newsletterMute("abcd@newsletter")
165
+ ```
166
+
167
+ ### 🔄 Newsletter Management
168
+ ```typescript
169
+ // Create new newsletter
170
+ const metadata = await sock.newsletterCreate("Newsletter Name", "Newsletter Description")
171
+ console.log(metadata)
172
+
173
+ // Delete newsletter
174
+ await sock.newsletterDelete("abcd@newsletter")
175
+
176
+ // Follow newsletter
177
+ await sock.newsletterFollow("abcd@newsletter")
178
+
179
+ // Unfollow newsletter
180
+ await sock.newsletterUnfollow("abcd@newsletter")
181
+ ```
182
+
183
+ ### 😀 Engagement Features
184
+ ```typescript
185
+ // Send reaction to newsletter post
186
+ // Get ID from message URL: https://whatsapp.com/channel/xxxxx/175
187
+ const id = "175"
188
+ await sock.newsletterReactMessage("abcd@newsletter", id, "🥳")
189
+ ```
190
+
191
+ </div>
192
+ </details>
193
+
194
+ ## 🎛️ | INTERACTIVE MESSAGING
195
+
196
+ <details>
197
+ <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>
198
+
199
+ <div style="padding: 15px; background: rgba(236, 72, 153, 0.05); border-radius: 0 0 10px 10px; margin-top: -5px;">
200
+
201
+ ### 📝 Text Buttons
202
+ ```typescript
203
+ const buttons = [
204
+ { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
205
+ { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
206
+ ]
207
+
208
+ const buttonMessage = {
209
+ text: "Hi it's button message",
210
+ footer: 'Hello World',
211
+ buttons,
212
+ headerType: 1,
213
+ viewOnce: true
214
+ }
215
+
216
+ await sock.sendMessage(id, buttonMessage, { quoted: null })
217
+ ```
218
+
219
+ ### 🖼️ Image Buttons
220
+ ```typescript
221
+ const buttons = [
222
+ { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
223
+ { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
224
+ ]
225
+
226
+ const buttonMessage = {
227
+ image: { url: "https://example.com/abcd.jpg" }, // image: buffer or path
228
+ caption: "Hi it's button message with image",
229
+ footer: 'Hello World',
230
+ buttons,
231
+ headerType: 1,
232
+ viewOnce: true
233
+ }
234
+
235
+ await sock.sendMessage(id, buttonMessage, { quoted: null })
236
+ ```
237
+
238
+ ### 🎬 Video Buttons
239
+ ```typescript
240
+ const buttons = [
241
+ { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
242
+ { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
243
+ ]
244
+
245
+ const buttonMessage = {
246
+ video: { url: "https://example.com/abcd.mp4" }, // video: buffer or path
247
+ caption: "Hi it's button message with video",
248
+ footer: 'Hello World',
249
+ buttons,
250
+ headerType: 1,
251
+ viewOnce: true
252
+ }
253
+
254
+ await sock.sendMessage(id, buttonMessage, { quoted: null })
255
+ ```
256
+
257
+ ### 🔄 Advanced Interactive Messages
258
+ ```typescript
259
+ const interactiveButtons = [
260
+ {
261
+ name: "quick_reply",
262
+ buttonParamsJson: JSON.stringify({
263
+ display_text: "Quick Reply",
264
+ id: "ID"
265
+ })
266
+ },
267
+ {
268
+ name: "cta_url",
269
+ buttonParamsJson: JSON.stringify({
270
+ display_text: "Tap Here!",
271
+ url: "https://www.example.com/"
272
+ })
273
+ },
274
+ {
275
+ name: "cta_copy",
276
+ buttonParamsJson: JSON.stringify({
277
+ display_text: "Copy Code",
278
+ id: "12345",
279
+ copy_code: "12345"
280
+ })
281
+ }
282
+ ]
283
+
284
+ const interactiveMessage = {
285
+ text: "Hello World!",
286
+ title: "this is the title",
287
+ footer: "this is the footer",
288
+ interactiveButtons
289
+ }
290
+
291
+ await sock.sendMessage(id, interactiveMessage, { quoted: null })
292
+ ```
293
+
294
+ ### 🖼️ Rich Media Interactive Messages
295
+ ```typescript
296
+ const interactiveButtons = [
297
+ {
298
+ name: "quick_reply",
299
+ buttonParamsJson: JSON.stringify({
300
+ display_text: "Quick Reply",
301
+ id: "ID"
302
+ })
303
+ },
304
+ {
305
+ name: "cta_url",
306
+ buttonParamsJson: JSON.stringify({
307
+ display_text: "Visit Website",
308
+ url: "https://www.example.com/"
309
+ })
310
+ }
311
+ ]
312
+
313
+ // With Image
314
+ const imageInteractiveMessage = {
315
+ image: { url: "https://example.com/abcd.jpg" },
316
+ caption: "Check out this amazing photo!",
317
+ title: "Photo Showcase",
318
+ footer: "Tap a button below",
319
+ interactiveButtons
320
+ }
321
+
322
+ await sock.sendMessage(id, imageInteractiveMessage, { quoted: null })
323
+
324
+ // With Video
325
+ const videoInteractiveMessage = {
326
+ video: { url: "https://example.com/abcd.mp4" },
327
+ caption: "Watch this awesome video!",
328
+ title: "Video Showcase",
329
+ footer: "Tap a button below",
330
+ interactiveButtons
331
+ }
332
+
333
+ await sock.sendMessage(id, videoInteractiveMessage, { quoted: null })
334
+ ```
335
+
336
+ </div>
337
+ </details>
338
+
339
+ ## 🤖 | AI MESSAGING
340
+
341
+ <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;">
342
+
343
+ ### AI Icon Feature
344
+ ```typescript
345
+ // Simply add "ai: true" to display AI icon with your message
346
+ await sock.sendMessage(id, { text: "Hello! I'm your AI assistant.", ai: true })
347
+ ```
348
+
349
+ <div style="background: rgba(16, 185, 129, 0.2); border-radius: 5px; padding: 10px; margin-top: 15px;">
350
+ <strong>💡 Pro Tip:</strong> AI icons make your bot messages stand out and indicate automated responses to users.
351
+ </div>
352
+
353
+ </div>
354
+
355
+ ## 🔐 | CUSTOM PAIRING
356
+
357
+ <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;">
358
+
359
+ ### Custom Code Implementation
360
+ ```typescript
361
+ if(usePairingCode && !sock.authState.creds.registered) {
362
+ const phoneNumber = await question('Please enter your mobile phone number:\n')
363
+ const custom = "4NY4P8KA" // must be 8 digits, can be letters or numbers
364
+ const code = await sock.requestPairingCode(phoneNumber, custom)
365
+ console.log(`Pairing code: ${code?.match(/.{1,4}/g)?.join('-') || code}`)
366
+ }
367
+ ```
368
+
369
+ <div style="background: rgba(245, 158, 11, 0.2); border-radius: 5px; padding: 10px; margin-top: 15px;">
370
+ <strong>🔒 Security Note:</strong> Custom pairing codes enhance security while providing a personalized experience.
371
+ </div>
372
+
373
+ </div>
374
+
375
+ <div align="center">
376
+ <img src="https://capsule-render.vercel.app/api?type=rect&color=gradient&height=2&section=header" width="100%">
377
+ </div>
378
+
379
+ ## 🛠️ | QUICK IMPLEMENTATION GUIDE
380
+
381
+ <div style="display: flex; flex-wrap: wrap; gap: 15px; margin: 20px 0;">
382
+ <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
383
+ <h3>🚀 Step 1: Install</h3>
384
+ <p>Add baileys-anya to your project using npm</p>
385
+ <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
386
+ <code>npm install baileys-anya</code>
387
+ <p>OR</p>
388
+ <code>yarn add baileys-anya</code>
389
+ <p>OR</p>
390
+ <code>pnpm add baileys-anya</code>
391
+ </div>
392
+ </div>
393
+
394
+ <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
395
+ <h3>🔄 Step 2: Import</h3>
396
+ <p>Import the library into your project</p>
397
+ <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
398
+ <code>import makeWASocket from 'baileys-anya'</code>
399
+ </div>
400
+ </div>
401
+
402
+ <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
403
+ <h3>⚙️ Step 3: Configure</h3>
404
+ <p>Set up your WhatsApp connection</p>
405
+ <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
406
+ <code>const sock = makeWASocket({...})</code>
407
+ </div>
408
+ </div>
409
+
410
+ <div style="flex: 1; min-width: 250px; background: rgba(59, 130, 246, 0.05); border-radius: 10px; padding: 15px;">
411
+ <h3>🚀 Step 4: Implement</h3>
412
+ <p>Start using the enhanced features</p>
413
+ <div style="background: rgba(0, 0, 0, 0.2); padding: 10px; border-radius: 5px;">
414
+ <code>await sock.sendMessage(id, {...})</code>
415
+ </div>
416
+ </div>
417
+ </div>
418
+
419
+ ## 🐛 | REPORTING ISSUES
420
+
421
+ <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;">
422
+ <h3>Found a bug? Have a suggestion?</h3>
423
+ <p>If you encounter any issues while using this repository, please feel free to open a <a href="https://github.com/teamolduser/bail/issues" style="color: #60A5FA; text-decoration: none; font-weight: bold;">new issue</a>.</p>
424
+
425
+ <div style="display: flex; align-items: center; gap: 10px; margin-top: 15px; background: rgba(239, 68, 68, 0.1); padding: 10px; border-radius: 5px;">
426
+ <span style="font-size: 24px;">👾</span>
427
+ <span>Our team actively monitors and responds to all issues.</span>
428
+ </div>
429
+ </div>
430
+
431
+ ## 📝 | NOTES
432
+
433
+ <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;">
434
+ <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>
435
+ </div>
436
+
437
+ <div align="center">
438
+ <img src="https://capsule-render.vercel.app/api?type=waving&color=gradient&height=100&section=footer" width="100%">
439
+ </div>
440
+
441
+ <div align="center" style="margin-top: -40px;">
442
+ <div style="background: linear-gradient(90deg, #6366F1, #3B82F6, #2DD4BF); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-size: 24px; font-weight: bold; margin-bottom: 10px;">
443
+ ⭐ STAR THIS REPOSITORY ⭐
444
+ </div>
445
+
446
+ <div style="display: flex; justify-content: center; gap: 10px; margin: 20px 0;">
447
+ <div style="background: rgba(6, 182, 212, 0.1); border-radius: 5px; padding: 8px 15px;">
448
+ <span style="font-size: 20px;">👨‍💻</span> <span>Developers</span>
449
+ </div>
450
+ <div style="background: rgba(16, 185, 129, 0.1); border-radius: 5px; padding: 8px 15px;">
451
+ <span style="font-size: 20px;">🤖</span> <span>Bot Creators</span>
452
+ </div>
453
+ <div style="background: rgba(245, 158, 11, 0.1); border-radius: 5px; padding: 8px 15px;">
454
+ <span style="font-size: 20px;">🚀</span> <span>Innovators</span>
455
+ </div>
456
+ </div>
457
+
458
+ <p style="font-style: italic; max-width: 600px; margin: 0 auto;">Powered by Baileys-Anya - The Ultimate WhatsApp Web API Experience</p>
459
+ </div>