@kurtucoben/baileys 0.0.2

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 (196) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +431 -0
  3. package/WAProto/index.js +169661 -0
  4. package/engine-requirements.js +10 -0
  5. package/lib/Defaults/index.d.ts +53 -0
  6. package/lib/Defaults/index.js +147 -0
  7. package/lib/Defaults/kurtucoben-baileys-version.json +3 -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/Group/telegram +1 -0
  36. package/lib/Signal/libsignal.d.ts +3 -0
  37. package/lib/Signal/libsignal.js +174 -0
  38. package/lib/Socket/Client/abstract-socket-client.d.ts +17 -0
  39. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  40. package/lib/Socket/Client/index.d.ts +3 -0
  41. package/lib/Socket/Client/index.js +19 -0
  42. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  43. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  44. package/lib/Socket/Client/web-socket-client.d.ts +12 -0
  45. package/lib/Socket/Client/web-socket-client.js +62 -0
  46. package/lib/Socket/business.d.ts +171 -0
  47. package/lib/Socket/business.js +260 -0
  48. package/lib/Socket/chats.d.ts +267 -0
  49. package/lib/Socket/chats.js +970 -0
  50. package/lib/Socket/dugong.js +480 -0
  51. package/lib/Socket/groups.d.ts +115 -0
  52. package/lib/Socket/groups.js +317 -0
  53. package/lib/Socket/index.d.ts +173 -0
  54. package/lib/Socket/index.js +11 -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 +909 -0
  59. package/lib/Socket/newsletter.d.ts +134 -0
  60. package/lib/Socket/newsletter.js +315 -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 +43 -0
  64. package/lib/Socket/socket.js +665 -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/Types/telegram +1 -0
  110. package/lib/Utils/auth-utils.d.ts +18 -0
  111. package/lib/Utils/auth-utils.js +206 -0
  112. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  113. package/lib/Utils/baileys-event-stream.js +63 -0
  114. package/lib/Utils/business.d.ts +22 -0
  115. package/lib/Utils/business.js +234 -0
  116. package/lib/Utils/chat-utils.d.ts +71 -0
  117. package/lib/Utils/chat-utils.js +729 -0
  118. package/lib/Utils/crypto.d.ts +41 -0
  119. package/lib/Utils/crypto.js +151 -0
  120. package/lib/Utils/decode-wa-message.d.ts +19 -0
  121. package/lib/Utils/decode-wa-message.js +198 -0
  122. package/lib/Utils/event-buffer.d.ts +35 -0
  123. package/lib/Utils/event-buffer.js +514 -0
  124. package/lib/Utils/generics.d.ts +92 -0
  125. package/lib/Utils/generics.js +423 -0
  126. package/lib/Utils/history.d.ts +15 -0
  127. package/lib/Utils/history.js +96 -0
  128. package/lib/Utils/index.d.ts +17 -0
  129. package/lib/Utils/index.js +33 -0
  130. package/lib/Utils/kurtucoben-connection.d.ts +11 -0
  131. package/lib/Utils/kurtucoben-connection.js +229 -0
  132. package/lib/Utils/link-preview.d.ts +21 -0
  133. package/lib/Utils/link-preview.js +93 -0
  134. package/lib/Utils/logger.d.ts +4 -0
  135. package/lib/Utils/logger.js +7 -0
  136. package/lib/Utils/lt-hash.d.ts +12 -0
  137. package/lib/Utils/lt-hash.js +51 -0
  138. package/lib/Utils/make-mutex.d.ts +7 -0
  139. package/lib/Utils/make-mutex.js +43 -0
  140. package/lib/Utils/messages-media.d.ts +116 -0
  141. package/lib/Utils/messages-media.js +819 -0
  142. package/lib/Utils/messages.d.ts +77 -0
  143. package/lib/Utils/messages.js +816 -0
  144. package/lib/Utils/noise-handler.d.ts +21 -0
  145. package/lib/Utils/noise-handler.js +155 -0
  146. package/lib/Utils/process-message.d.ts +41 -0
  147. package/lib/Utils/process-message.js +321 -0
  148. package/lib/Utils/signal.d.ts +32 -0
  149. package/lib/Utils/signal.js +153 -0
  150. package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
  151. package/lib/Utils/use-multi-file-auth-state.js +119 -0
  152. package/lib/WABinary/constants.d.ts +30 -0
  153. package/lib/WABinary/constants.js +40 -0
  154. package/lib/WABinary/decode.d.ts +7 -0
  155. package/lib/WABinary/decode.js +252 -0
  156. package/lib/WABinary/encode.d.ts +3 -0
  157. package/lib/WABinary/encode.js +265 -0
  158. package/lib/WABinary/generic-utils.d.ts +17 -0
  159. package/lib/WABinary/generic-utils.js +198 -0
  160. package/lib/WABinary/index.d.ts +5 -0
  161. package/lib/WABinary/index.js +21 -0
  162. package/lib/WABinary/jid-utils.d.ts +31 -0
  163. package/lib/WABinary/jid-utils.js +62 -0
  164. package/lib/WABinary/types.d.ts +18 -0
  165. package/lib/WABinary/types.js +2 -0
  166. package/lib/WAM/BinaryInfo.d.ts +17 -0
  167. package/lib/WAM/BinaryInfo.js +13 -0
  168. package/lib/WAM/constants.d.ts +38 -0
  169. package/lib/WAM/constants.js +15350 -0
  170. package/lib/WAM/encode.d.ts +3 -0
  171. package/lib/WAM/encode.js +155 -0
  172. package/lib/WAM/index.d.ts +3 -0
  173. package/lib/WAM/index.js +19 -0
  174. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  175. package/lib/WAUSync/Protocols/USyncContactProtocol.js +31 -0
  176. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  177. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  178. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  179. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  180. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  181. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  182. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
  183. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
  184. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
  185. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
  186. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  187. package/lib/WAUSync/Protocols/index.js +20 -0
  188. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  189. package/lib/WAUSync/USyncQuery.js +89 -0
  190. package/lib/WAUSync/USyncUser.d.ts +12 -0
  191. package/lib/WAUSync/USyncUser.js +26 -0
  192. package/lib/WAUSync/index.d.ts +3 -0
  193. package/lib/WAUSync/index.js +19 -0
  194. package/lib/index.d.ts +12 -0
  195. package/lib/index.js +42 -0
  196. package/package.json +113 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kurtu Coben
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,431 @@
1
+ # <div align='center'>WhatsApp Web API</div>
2
+
3
+ <div align='center'>
4
+
5
+ ![WhatsApp API by Kurtu Coben](https://raw.githubusercontent.com/KurtuCoben/KurtuCoben-baileys/main/%40kurtucoben-baileys.jpg)
6
+
7
+ </div>
8
+
9
+ Looking to build something cool with WhatsApp? Check out WhatsApp Baileys an open-source library that lets you create smooth automations and integrations directly with WhatsApp. Instead of relying on a browser, it uses websocket technology to keep things light and efficient.
10
+
11
+ With Baileys, you can handle messages, manage chats and groups, create interactive messages with buttons, and build dynamic menus for a richer experience. It’s actively maintained, so updates regularly roll out to boost stability and performance. One big focus has been improving the pairing and login process making it more secure, reliable, and way less likely to drop off unexpectedly. You can even customize the pairing with your own code for extra control.
12
+
13
+ Whether you’re building a business bot, a customer service helper, or any kind of chat automation, Baileys is built to stay stable and packed with features. It’s designed to be modular and easy to plug into different systems, so you won’t get bogged down.
14
+
15
+ ## How to use?
16
+
17
+ just type like this shit
18
+ ```bash
19
+ npm install @kurtucoben/baileys
20
+ ```
21
+ or
22
+ ```bash
23
+ yarn add @kurtucoben/baileys
24
+ ```
25
+ import your code to create a connection to the library
26
+ ```javascript
27
+ const {
28
+ default: makeWASocket,
29
+ generateWAMessageFromContent,
30
+ prepareWAMessageMedia,
31
+ useMultiFileAuthState,
32
+ Browsers,
33
+ DisconnectReason,
34
+ makeInMemoryStore,
35
+ makeCacheableSignalKeyStore,
36
+ fetchLatestBaileysVersion,
37
+ proto,
38
+ PHONENUMBER_MCC,
39
+ getAggregateVotesInPollMessage,
40
+ delay,
41
+ areJidsSameUser
42
+ } = require('@kurtucoben/baileys');
43
+ ```
44
+ ```javascript
45
+ const {
46
+ default: WAConnection, makeWAMessage,
47
+ makeCacheableSignalKeyStore, downloadContentFromMessage,
48
+ emitGroupParticipantsUpdate, emitGroupUpdate,
49
+ generateWAMessageContent, generateWAMessage,
50
+ makeInMemoryStore, prepareWAMessageMedia,
51
+ generateWAMessageFromContent, MediaType,
52
+ areJidsSameUser, WAMessageStatus,
53
+ downloadAndSaveMediaMessage, AuthenticationState,
54
+ GroupMetadata, initInMemoryKeyStore, getContentType,
55
+ MiscMessageGenerationOptionsuseSingleFileAuthState, BufferJSON,
56
+ WAMessageProto, MessageOptions, WAFlag, WANode, WAMetric,
57
+ ChatModification, MessageTypeProto, WALocationMessage,
58
+ ReconnectMode, WAContextInfo, proto, WAGroupMetadata, ProxyAgent,
59
+ waChatKey, MimetypeMap, MediaPathMap, WAContactMessage,
60
+ WAContactsArrayMessage, WAGroupInviteMessage,
61
+ WATextMessage, WAMessageContent, WAMessage, BaileysError,
62
+ WA_MESSAGE_STATUS_TYPE, MediaConnInfo, URL_REGEX, WAUrlInfo,
63
+ WA_DEFAULT_EPHEMERAL, WAMediaUpload, mentionedJid,
64
+ Browser, MessageType, Presence, WA_MESSAGE_STUB_TYPES,
65
+ Mimetype, relayWAMessage, Browsers, GroupSettingChange,
66
+ DisconnectReason, getStream, WAProto, isBaileys, PHONENUMBER_MCC,
67
+ AnyMessageContent, useMultiFileAuthState, fetchLatestBaileysVersion,
68
+ templateMessage, InteractiveMessage, Header } = require("@kurtucoben/baileys");
69
+ ```
70
+ ---
71
+ # Links
72
+
73
+ #### Social Media
74
+ - [Instagram](https://www.instagram.com/krtucbens)
75
+
76
+ #### Follow For More Updates & Information
77
+ - [WhatsApp Channel](https://whatsapp.com/channel/0029VajIECpGU3BIejJB1t18)
78
+
79
+ <div align='center'>
80
+
81
+ ![Kurt Cobain Smile For You](https://raw.githubusercontent.com/KurtuCoben/KurtuCoben-baileys/main/kurtcobain.gif)
82
+
83
+ </div>
84
+
85
+ ### Why developers like it:
86
+
87
+ - Pairing is more stable now - fewer fails and disconnections
88
+ - Supports interactive messages, buttons, and dynamic menus
89
+ - Supports interactive messages, action buttons, and dynamic menus
90
+ - Manages sessions smoothly in the background
91
+ - Works with WhatsApp’s latest multi-device feature
92
+ - Lightweight and modular design for easy integration and customization
93
+ - Comes with clear docs and ready-to-use examples
94
+
95
+ ---
96
+
97
+ ## Ready to start?
98
+
99
+ Grab the library via npm or your package manager of choice, tweak the config, and dive right in. The example code is a great place to see how everything fits together. Use session storage and interactive features to build something solid that fits your project perfectly.
100
+
101
+ ---
102
+
103
+ ## SendMessage Documentation
104
+
105
+ ### Album Message (Multiple Images)
106
+ Send multiple images in a single album message:
107
+
108
+ ```javascript
109
+ await sock.sendMessage(jid, {
110
+ albumMessage: [
111
+ { image: maskurtu, caption: "Foto pertama" },
112
+ { image: { url: "URL IMAGE" }, caption: "Foto kedua" }
113
+ ]
114
+ }, { quoted: m });
115
+ ```
116
+
117
+ ### Event Message
118
+ Create and send WhatsApp event invitations:
119
+
120
+ ```javascript
121
+ await sock.sendMessage(jid, {
122
+ eventMessage: {
123
+ isCanceled: false,
124
+ name: "Hello World",
125
+ description: "lorem ipsum dolor sit amet",
126
+ location: {
127
+ degreesLatitude: 0,
128
+ degreesLongitude: 0,
129
+ name: "rowrrrr"
130
+ },
131
+ joinLink: "https://call.whatsapp.com/video/krtucbens",
132
+ startTime: "1763019000",
133
+ endTime: "1763026200",
134
+ extraGuestsAllowed: false
135
+ }
136
+ }, { quoted: m });
137
+ ```
138
+
139
+ ### Poll Result Message
140
+ Display poll results with vote counts:
141
+
142
+ ```javascript
143
+ await sock.sendMessage(jid, {
144
+ pollResultMessage: {
145
+ name: "Hello World",
146
+ pollVotes: [
147
+ {
148
+ optionName: "TEST 1",
149
+ optionVoteCount: "112233"
150
+ },
151
+ {
152
+ optionName: "TEST 2",
153
+ optionVoteCount: "1"
154
+ }
155
+ ]
156
+ }
157
+ }, { quoted: m });
158
+ ```
159
+
160
+ ### Simple Interactive Message
161
+ Send basic interactive messages with copy button functionality:
162
+
163
+ ```javascript
164
+ await sock.sendMessage(jid, {
165
+ interactiveMessage: {
166
+ header: "Hello World",
167
+ title: "Hello World",
168
+ footer: "instagram: @krtucbens ",
169
+ buttons: [
170
+ {
171
+ name: "cta_copy",
172
+ buttonParamsJson: JSON.stringify({
173
+ display_text: "copy code",
174
+ id: "123456789",
175
+ copy_code: "ABC123XYZ"
176
+ })
177
+ }
178
+ ]
179
+ }
180
+ }, { quoted: m });
181
+ ```
182
+
183
+ ### Interactive Message with Native Flow
184
+ Send interactive messages with buttons, copy actions, and native flow features:
185
+
186
+ ```javascript
187
+ await sock.sendMessage(jid, {
188
+ interactiveMessage: {
189
+ header: "Hello World",
190
+ title: "Hello World",
191
+ footer: "instagram: @krtucbens",
192
+ image: { url: "https://example.com/image.jpg" },
193
+ nativeFlowMessage: {
194
+ messageParamsJson: JSON.stringify({
195
+ limited_time_offer: {
196
+ text: "bahlil ajg",
197
+ url: "https://ig.me/m/krtucbens",
198
+ copy_code: "maskurtu",
199
+ expiration_time: Date.now() * 999
200
+ },
201
+ bottom_sheet: {
202
+ in_thread_buttons_limit: 2,
203
+ divider_indices: [1, 2, 3, 4, 5, 999],
204
+ list_title: "lorem ipsum dolor sit amet",
205
+ button_title: "lorem ipsum dolor sit amet"
206
+ },
207
+ tap_target_configuration: {
208
+ title: " X ",
209
+ description: "FawkNyggers",
210
+ canonical_url: "https://ig.me/m/krtucbens",
211
+ domain: "shop.example.com",
212
+ button_index: 0
213
+ }
214
+ }),
215
+ buttons: [
216
+ {
217
+ name: "single_select",
218
+ buttonParamsJson: JSON.stringify({
219
+ has_multiple_buttons: true
220
+ })
221
+ },
222
+ {
223
+ name: "call_permission_request",
224
+ buttonParamsJson: JSON.stringify({
225
+ has_multiple_buttons: true
226
+ })
227
+ },
228
+ {
229
+ name: "single_select",
230
+ buttonParamsJson: JSON.stringify({
231
+ title: "Hello World",
232
+ sections: [
233
+ {
234
+ title: "title",
235
+ highlight_label: "label",
236
+ rows: [
237
+ {
238
+ title: "maskurtu",
239
+ description: "lop yu",
240
+ id: "row_2"
241
+ }
242
+ ]
243
+ }
244
+ ],
245
+ has_multiple_buttons: true
246
+ })
247
+ },
248
+ {
249
+ name: "cta_copy",
250
+ buttonParamsJson: JSON.stringify({
251
+ display_text: "copy code",
252
+ id: "123456789",
253
+ copy_code: "ABC123XYZ"
254
+ })
255
+ }
256
+ ]
257
+ }
258
+ }
259
+ }, { quoted: m });
260
+ ```
261
+
262
+ ### Interactive Message with Thumbnail
263
+ Send interactive messages with thumbnail image and copy button:
264
+
265
+ ```javascript
266
+ await sock.sendMessage(jid, {
267
+ interactiveMessage: {
268
+ header: "Hello World",
269
+ title: "Hello World",
270
+ footer: "Instagram: @krtucbens",
271
+ image: { url: "https://example.com/image.jpg" },
272
+ buttons: [
273
+ {
274
+ name: "cta_copy",
275
+ buttonParamsJson: JSON.stringify({
276
+ display_text: "copy code",
277
+ id: "123456789",
278
+ copy_code: "ABC123XYZ"
279
+ })
280
+ }
281
+ ]
282
+ }
283
+ }, { quoted: m });
284
+ ```
285
+
286
+ ### Product Message
287
+ Send product catalog messages with buttons and merchant information:
288
+
289
+ ```javascript
290
+ await sock.sendMessage(jid, {
291
+ productMessage: {
292
+ title: "Produk Contoh",
293
+ description: "Ini adalah deskripsi produk",
294
+ thumbnail: { url: "https://example.com/image.jpg" },
295
+ productId: "PROD001",
296
+ retailerId: "RETAIL001",
297
+ url: "https://example.com/product",
298
+ body: "Detail produk",
299
+ footer: "Harga spesial",
300
+ priceAmount1000: 50000,
301
+ currencyCode: "USD",
302
+ buttons: [
303
+ {
304
+ name: "cta_url",
305
+ buttonParamsJson: JSON.stringify({
306
+ display_text: "Beli Sekarang",
307
+ url: "https://example.com/buy"
308
+ })
309
+ }
310
+ ]
311
+ }
312
+ }, { quoted: m });
313
+ ```
314
+
315
+ ### Interactive Message with Document Buffer
316
+ Send interactive messages with document from buffer (file system) - **Note: Documents only support buffer**:
317
+
318
+ ```javascript
319
+ await sock.sendMessage(jid, {
320
+ interactiveMessage: {
321
+ header: "Hello World",
322
+ title: "Hello World",
323
+ footer: "Instagram: @krtucbens",
324
+ document: fs.readFileSync("./package.json"),
325
+ mimetype: "application/pdf",
326
+ fileName: "Epstein.pdf",
327
+ jpegThumbnail: fs.readFileSync("./document.jpeg"),
328
+ contextInfo: {
329
+ mentionedJid: [jid],
330
+ forwardingScore: 777,
331
+ isForwarded: false
332
+ },
333
+ externalAdReply: {
334
+ title: "Wabot",
335
+ body: "bot wacap",
336
+ mediaType: 3,
337
+ thumbnailUrl: "https://example.com/image.jpg",
338
+ mediaUrl: " X ",
339
+ sourceUrl: "https://ig.me/m/krtucbens",
340
+ showAdAttribution: true,
341
+ renderLargerThumbnail: false
342
+ },
343
+ buttons: [
344
+ {
345
+ name: "cta_url",
346
+ buttonParamsJson: JSON.stringify({
347
+ display_text: "Instagram",
348
+ url: "https://ig.me/m/krtucbens",
349
+ merchant_url: "https://ig.me/m/krtucbens"
350
+ })
351
+ }
352
+ ]
353
+ }
354
+ }, { quoted: m });
355
+ ```
356
+
357
+ ### Interactive Message with Document Buffer (Simple)
358
+ Send interactive messages with document from buffer (file system) without contextInfo and externalAdReply - **Note: Documents only support buffer**:
359
+
360
+ ```javascript
361
+ await sock.sendMessage(jid, {
362
+ interactiveMessage: {
363
+ header: "Hello World",
364
+ title: "Hello World",
365
+ footer: "Instagram: @krtucbens",
366
+ document: fs.readFileSync("./package.json"),
367
+ mimetype: "application/pdf",
368
+ fileName: "Epstein.pdf",
369
+ jpegThumbnail: fs.readFileSync("./document.jpeg"),
370
+ buttons: [
371
+ {
372
+ name: "cta_url",
373
+ buttonParamsJson: JSON.stringify({
374
+ display_text: "Instagram",
375
+ url: "https://ig.me/m/krtucbens",
376
+ merchant_url: "https://ig.me/m/krtucbens"
377
+ })
378
+ }
379
+ ]
380
+ }
381
+ }, { quoted: m });
382
+ ```
383
+
384
+ ### Request Payment Message
385
+ Send payment request messages with custom background and sticker:
386
+
387
+ ```javascript
388
+ let quotedType = m.quoted?.mtype || '';
389
+ let quotedContent = JSON.stringify({ [quotedType]: m.quoted }, null, 2);
390
+
391
+ await sock.sendMessage(jid, {
392
+ requestPaymentMessage: {
393
+ currency: "IDR",
394
+ amount: 10000000,
395
+ from: m.sender,
396
+ sticker: JSON.parse(quotedContent),
397
+ background: {
398
+ id: "100",
399
+ fileLength: "0",
400
+ width: 1000,
401
+ height: 1000,
402
+ mimetype: "image/webp",
403
+ placeholderArgb: 0xFF00FFFF,
404
+ textArgb: 0xFFFFFFFF,
405
+ subtextArgb: 0xFFAA00FF
406
+ }
407
+ }
408
+ }, { quoted: m });
409
+ ```
410
+
411
+ ---
412
+
413
+ ## Why should choose my baileys?
414
+
415
+ This library delivers exceptional stability, a comprehensive feature set, and a continuously refined pairing process making it the ideal choice for building professional, secure WhatsApp automation. It also stays current with WhatsApp’s latest updates, so your projects remain compatible and future-proof.
416
+
417
+ ---
418
+
419
+ ### Technical Highlights
420
+
421
+ - Stable, secure custom pairing with resolved authentication issues
422
+ - Support for interactive messages, action buttons, and dynamic menus
423
+ - Efficient automatic session management for long-term reliability
424
+ - Full compatibility with WhatsApp’s multi-device feature
425
+ - Compatible with the latest multi-device features from WhatsApp
426
+ - Easy to integrate and customize based on your needs
427
+ - Perfect for developing bots, customer service automation, and other communication applications
428
+
429
+ ---
430
+
431
+ **Thanks for using our library! We're constantly improving it to keep up with the evolving needs of developers working on WhatsApp automation.**