byleeosbaileys 2.0.0

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 +491 -0
  2. package/WAProto/index.js +169661 -0
  3. package/engine-requirements.js +10 -0
  4. package/lib/Defaults/baileys-version.json +3 -0
  5. package/lib/Defaults/index.d.ts +53 -0
  6. package/lib/Defaults/index.js +147 -0
  7. package/lib/Defaults/phonenumber-mcc.json +223 -0
  8. package/lib/Signal/Group/ciphertext-message.d.ts +9 -0
  9. package/lib/Signal/Group/ciphertext-message.js +15 -0
  10. package/lib/Signal/Group/group-session-builder.d.ts +14 -0
  11. package/lib/Signal/Group/group-session-builder.js +64 -0
  12. package/lib/Signal/Group/group_cipher.d.ts +17 -0
  13. package/lib/Signal/Group/group_cipher.js +96 -0
  14. package/lib/Signal/Group/index.d.ts +11 -0
  15. package/lib/Signal/Group/index.js +57 -0
  16. package/lib/Signal/Group/keyhelper.d.ts +10 -0
  17. package/lib/Signal/Group/keyhelper.js +55 -0
  18. package/lib/Signal/Group/queue-job.d.ts +1 -0
  19. package/lib/Signal/Group/queue-job.js +57 -0
  20. package/lib/Signal/Group/sender-chain-key.d.ts +13 -0
  21. package/lib/Signal/Group/sender-chain-key.js +34 -0
  22. package/lib/Signal/Group/sender-key-distribution-message.d.ts +16 -0
  23. package/lib/Signal/Group/sender-key-distribution-message.js +66 -0
  24. package/lib/Signal/Group/sender-key-message.d.ts +18 -0
  25. package/lib/Signal/Group/sender-key-message.js +69 -0
  26. package/lib/Signal/Group/sender-key-name.d.ts +17 -0
  27. package/lib/Signal/Group/sender-key-name.js +51 -0
  28. package/lib/Signal/Group/sender-key-record.d.ts +30 -0
  29. package/lib/Signal/Group/sender-key-record.js +53 -0
  30. package/lib/Signal/Group/sender-key-state.d.ts +38 -0
  31. package/lib/Signal/Group/sender-key-state.js +99 -0
  32. package/lib/Signal/Group/sender-message-key.d.ts +11 -0
  33. package/lib/Signal/Group/sender-message-key.js +29 -0
  34. package/lib/Signal/libsignal.d.ts +3 -0
  35. package/lib/Signal/libsignal.js +174 -0
  36. package/lib/Socket/Client/abstract-socket-client.d.ts +17 -0
  37. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  38. package/lib/Socket/Client/index.d.ts +3 -0
  39. package/lib/Socket/Client/index.js +19 -0
  40. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  41. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  42. package/lib/Socket/Client/web-socket-client.d.ts +12 -0
  43. package/lib/Socket/Client/web-socket-client.js +62 -0
  44. package/lib/Socket/business.d.ts +171 -0
  45. package/lib/Socket/business.js +260 -0
  46. package/lib/Socket/chats.d.ts +267 -0
  47. package/lib/Socket/chats.js +970 -0
  48. package/lib/Socket/dugong.d.ts +254 -0
  49. package/lib/Socket/dugong.js +484 -0
  50. package/lib/Socket/groups.d.ts +115 -0
  51. package/lib/Socket/groups.js +317 -0
  52. package/lib/Socket/index.d.ts +173 -0
  53. package/lib/Socket/index.js +11 -0
  54. package/lib/Socket/messages-recv.d.ts +161 -0
  55. package/lib/Socket/messages-recv.js +1110 -0
  56. package/lib/Socket/messages-send.d.ts +149 -0
  57. package/lib/Socket/messages-send.js +909 -0
  58. package/lib/Socket/newsletter.d.ts +134 -0
  59. package/lib/Socket/newsletter.js +315 -0
  60. package/lib/Socket/registration.d.ts +267 -0
  61. package/lib/Socket/registration.js +166 -0
  62. package/lib/Socket/socket.d.ts +43 -0
  63. package/lib/Socket/socket.js +665 -0
  64. package/lib/Socket/usync.d.ts +36 -0
  65. package/lib/Socket/usync.js +70 -0
  66. package/lib/Store/index.d.ts +3 -0
  67. package/lib/Store/index.js +10 -0
  68. package/lib/Store/make-cache-manager-store.d.ts +13 -0
  69. package/lib/Store/make-cache-manager-store.js +83 -0
  70. package/lib/Store/make-in-memory-store.d.ts +118 -0
  71. package/lib/Store/make-in-memory-store.js +427 -0
  72. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  73. package/lib/Store/make-ordered-dictionary.js +81 -0
  74. package/lib/Store/object-repository.d.ts +10 -0
  75. package/lib/Store/object-repository.js +27 -0
  76. package/lib/Types/Auth.d.ts +110 -0
  77. package/lib/Types/Auth.js +2 -0
  78. package/lib/Types/Call.d.ts +13 -0
  79. package/lib/Types/Call.js +2 -0
  80. package/lib/Types/Chat.d.ts +102 -0
  81. package/lib/Types/Chat.js +4 -0
  82. package/lib/Types/Contact.d.ts +19 -0
  83. package/lib/Types/Contact.js +2 -0
  84. package/lib/Types/Events.d.ts +157 -0
  85. package/lib/Types/Events.js +2 -0
  86. package/lib/Types/GroupMetadata.d.ts +55 -0
  87. package/lib/Types/GroupMetadata.js +2 -0
  88. package/lib/Types/Label.d.ts +35 -0
  89. package/lib/Types/Label.js +27 -0
  90. package/lib/Types/LabelAssociation.d.ts +29 -0
  91. package/lib/Types/LabelAssociation.js +9 -0
  92. package/lib/Types/Message.d.ts +273 -0
  93. package/lib/Types/Message.js +9 -0
  94. package/lib/Types/Newsletter.d.ts +103 -0
  95. package/lib/Types/Newsletter.js +38 -0
  96. package/lib/Types/Product.d.ts +78 -0
  97. package/lib/Types/Product.js +2 -0
  98. package/lib/Types/Signal.d.ts +57 -0
  99. package/lib/Types/Signal.js +2 -0
  100. package/lib/Types/Socket.d.ts +111 -0
  101. package/lib/Types/Socket.js +2 -0
  102. package/lib/Types/State.d.ts +27 -0
  103. package/lib/Types/State.js +2 -0
  104. package/lib/Types/USync.d.ts +25 -0
  105. package/lib/Types/USync.js +2 -0
  106. package/lib/Types/index.d.ts +57 -0
  107. package/lib/Types/index.js +42 -0
  108. package/lib/Utils/auth-utils.d.ts +18 -0
  109. package/lib/Utils/auth-utils.js +206 -0
  110. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  111. package/lib/Utils/baileys-event-stream.js +63 -0
  112. package/lib/Utils/business.d.ts +22 -0
  113. package/lib/Utils/business.js +234 -0
  114. package/lib/Utils/chat-utils.d.ts +71 -0
  115. package/lib/Utils/chat-utils.js +729 -0
  116. package/lib/Utils/crypto.d.ts +41 -0
  117. package/lib/Utils/crypto.js +151 -0
  118. package/lib/Utils/decode-wa-message.d.ts +19 -0
  119. package/lib/Utils/decode-wa-message.js +198 -0
  120. package/lib/Utils/event-buffer.d.ts +35 -0
  121. package/lib/Utils/event-buffer.js +514 -0
  122. package/lib/Utils/generics.d.ts +92 -0
  123. package/lib/Utils/generics.js +423 -0
  124. package/lib/Utils/history.d.ts +15 -0
  125. package/lib/Utils/history.js +96 -0
  126. package/lib/Utils/index.d.ts +17 -0
  127. package/lib/Utils/index.js +33 -0
  128. package/lib/Utils/link-preview.d.ts +21 -0
  129. package/lib/Utils/link-preview.js +93 -0
  130. package/lib/Utils/logger.d.ts +4 -0
  131. package/lib/Utils/logger.js +7 -0
  132. package/lib/Utils/lt-hash.d.ts +12 -0
  133. package/lib/Utils/lt-hash.js +51 -0
  134. package/lib/Utils/make-mutex.d.ts +7 -0
  135. package/lib/Utils/make-mutex.js +43 -0
  136. package/lib/Utils/messages-media.d.ts +116 -0
  137. package/lib/Utils/messages-media.js +819 -0
  138. package/lib/Utils/messages.d.ts +77 -0
  139. package/lib/Utils/messages.js +816 -0
  140. package/lib/Utils/noise-handler.d.ts +21 -0
  141. package/lib/Utils/noise-handler.js +155 -0
  142. package/lib/Utils/process-message.d.ts +41 -0
  143. package/lib/Utils/process-message.js +321 -0
  144. package/lib/Utils/signal.d.ts +32 -0
  145. package/lib/Utils/signal.js +153 -0
  146. package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
  147. package/lib/Utils/use-multi-file-auth-state.js +119 -0
  148. package/lib/Utils/validate-connection.d.ts +11 -0
  149. package/lib/Utils/validate-connection.js +229 -0
  150. package/lib/WABinary/constants.d.ts +30 -0
  151. package/lib/WABinary/constants.js +40 -0
  152. package/lib/WABinary/decode.d.ts +7 -0
  153. package/lib/WABinary/decode.js +252 -0
  154. package/lib/WABinary/encode.d.ts +3 -0
  155. package/lib/WABinary/encode.js +265 -0
  156. package/lib/WABinary/generic-utils.d.ts +17 -0
  157. package/lib/WABinary/generic-utils.js +198 -0
  158. package/lib/WABinary/index.d.ts +5 -0
  159. package/lib/WABinary/index.js +21 -0
  160. package/lib/WABinary/jid-utils.d.ts +31 -0
  161. package/lib/WABinary/jid-utils.js +62 -0
  162. package/lib/WABinary/types.d.ts +18 -0
  163. package/lib/WABinary/types.js +2 -0
  164. package/lib/WAM/BinaryInfo.d.ts +17 -0
  165. package/lib/WAM/BinaryInfo.js +13 -0
  166. package/lib/WAM/constants.d.ts +38 -0
  167. package/lib/WAM/constants.js +15350 -0
  168. package/lib/WAM/encode.d.ts +3 -0
  169. package/lib/WAM/encode.js +155 -0
  170. package/lib/WAM/index.d.ts +3 -0
  171. package/lib/WAM/index.js +19 -0
  172. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  173. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  174. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  175. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  176. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  177. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  178. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  179. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  180. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
  181. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +53 -0
  182. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
  183. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +24 -0
  184. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  185. package/lib/WAUSync/Protocols/index.js +20 -0
  186. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  187. package/lib/WAUSync/USyncQuery.js +89 -0
  188. package/lib/WAUSync/USyncUser.d.ts +12 -0
  189. package/lib/WAUSync/USyncUser.js +26 -0
  190. package/lib/WAUSync/index.d.ts +3 -0
  191. package/lib/WAUSync/index.js +19 -0
  192. package/lib/index.d.ts +12 -0
  193. package/lib/index.js +62 -0
  194. package/package.json +113 -0
package/README.md ADDED
@@ -0,0 +1,491 @@
1
+
2
+ ```
3
+ © Credits
4
+ Modified Baileys2 @rrey1st
5
+ Modified Baileys @daffadevv
6
+ Source Bailyes @yumevtc
7
+ ```
8
+
9
+ # WhatsApp Baileys
10
+
11
+ <p align="center">
12
+ <img src="https://h.top4top.io/p_35995wdvx1.jpg" alt="Thumbnail" />
13
+ </p>
14
+
15
+ WhatsApp Baileys adalah library open‑source yang dirancang untuk membantu developer membangun solusi otomatisasi dan integrasi dengan WhatsApp secara efisien dan langsung. Menggunakan teknologi webclient.t tanpa memerlukan browser, library ini mendukung berbagai fitur seperti manajemen pesan, penanganan chat, administrasi grup, serta pesan interaktif dan tombol aksi untuk pengalaman pengguna yang lebih dinamis.
16
+
17
+ Aktif dikembangkan dan dipelihara, baileys terus menerima pembaruan untuk meningkatkan stabilitas dan performa. Salah satu fokus utamanya adalah menyempurnakan proses pairing dan autentikasi agar lebih stabil dan aman. Fitur pairing dapat dikustomisasi dengan kode buatan sendiri, membuat proses lebih andal dan tidak mudah terganggu.
18
+
19
+ Library ini sangat cocok untuk membangun bot bisnis, sistem otomatisasi chat, solusi customer service, dan berbagai aplikasi otomatisasi komunikasi lainnya yang membutuhkan stabilitas tinggi dan fitur lengkap. Dengan desain ringan dan modular, baileys mudah diintegrasikan ke berbagai sistem dan platform.
20
+
21
+ ---
22
+
23
+ ### Fitur Utama dan Keunggulan
24
+
25
+ - Mendukung proses pairing otomatis dan kustom
26
+ - Memperbaiki masalah pairing sebelumnya yang sering menyebabkan gagal atau disconnect
27
+ - Mendukung pesan interaktif, tombol aksi, dan menu dinamis
28
+ - Manajemen sesi otomatis yang efisien dan andal
29
+ - Kompatibel dengan fitur multi-device terbaru WhatsApp
30
+ - Ringan, stabil, dan mudah diintegrasikan ke berbagai sistem
31
+ - Cocok untuk mengembangkan bot, otomatisasi, dan solusi komunikasi lengkap
32
+ - Dokumentasi dan contoh kode yang lengkap untuk memudahkan pengembangan
33
+
34
+ ---
35
+
36
+ ## Memulai
37
+
38
+ Mulailah dengan menginstal library melalui package manager pilihan Anda, lalu ikuti panduan konfigurasi yang tersedia. Anda juga dapat menggunakan contoh kode yang sudah disediakan untuk memahami cara kerja fitur-fitur tersebut. Gunakan penyimpanan sesi dan fitur pesan interaktif untuk membangun solusi lengkap dan stabil sesuai kebutuhan bisnis atau proyek Anda.
39
+
40
+ ---
41
+
42
+ ## Dokumentasi SendMessage
43
+
44
+ ### Order Message
45
+
46
+ ```javascript
47
+ await client.sendMessage(groupId, {
48
+ orderMessage: {
49
+ orderId: "7778",
50
+ thumbnail: await (await fetch("URL IMG")).buffer(),
51
+ itemCount: 1000,
52
+ status: "INQUIRY",
53
+ surface: "CATALOG",
54
+ message: "dfa kimochi",
55
+ orderTitle: "kyah",
56
+ sellerJid: "0@s.whatsapp.net",
57
+ token: Buffer.from("777777"),
58
+ totalAmount1000: 1000,
59
+ currencyCode: "IDR",
60
+ messageVersion: 2
61
+ }
62
+ }, { quoted: m });
63
+ ```
64
+
65
+ ### Review And Pay Message
66
+
67
+ ```javascript
68
+ await client.sendMessage(m.chat, {
69
+ nativeFlowMessage: {
70
+ buttons: [
71
+ {
72
+ name: "review_and_pay",
73
+ buttonParamsJson: JSON.stringify({
74
+ currency: "IDR",
75
+ total_amount: { value: 100, offset: 100 },
76
+ reference_id: "DAFFA-DEV",
77
+ type: "daffa",
78
+ payment_status: "ganteng",
79
+ payment_timestamp: Date.now(),
80
+ order: {
81
+ status: "completed",
82
+ subtotal: { value: 100, offset: 100 },
83
+ order_type: "PAYMENT_REQUEST",
84
+ items: [
85
+ {
86
+ retailer_id: "item-" + Math.floor(Math.random() * 1e9),
87
+ name: teks,
88
+ amount: { value: 100, offset: 100 },
89
+ quantity: 1
90
+ }
91
+ ]
92
+ },
93
+ additional_note: "daffa gntng bet jir",
94
+ native_payment_methods: "",
95
+ share_payment_status: true
96
+ })
97
+ }
98
+ ]
99
+ }
100
+ }
101
+ }, { quoted: m })
102
+ ```
103
+ ### Tag Status Grup Teks
104
+
105
+ ```javascript
106
+ await client.sendMessage(groupId, {
107
+ groupStatusMessage: {
108
+ text: "hello world"
109
+ }
110
+ });
111
+ ```
112
+
113
+ ### Tag Status Grup Gambar
114
+
115
+ ```javascript
116
+ const quoted = m.quoted ? m.quoted : m;
117
+ const mime = (quoted.msg || quoted).mimetype || "";
118
+ const caption = m.body.replace(/^\.swgrup\s*/i, "").trim();
119
+ const jid = m.chat;
120
+ if (/image/.test(mime)) {
121
+ const buffer = await quoted.download();
122
+ await client.sendMessage(groupId, {
123
+ groupStatusMessage: {
124
+ image: buffer,
125
+ caption
126
+ }
127
+ });
128
+ ```
129
+
130
+ ### Tag Status Grup Video
131
+
132
+ ```javascript
133
+ const quoted = m.quoted ? m.quoted : m;
134
+ const mime = (quoted.msg || quoted).mimetype || "";
135
+ const caption = m.body.replace(/^\.swgrup\s*/i, "").trim();
136
+ const jid = m.chat;
137
+ if (/video/.test(mime)) {
138
+ const buffer = await quoted.download();
139
+ await client.sendMessage(groupId, {
140
+ groupStatusMessage: {
141
+ video: buffer,
142
+ caption
143
+ }
144
+ });
145
+ ```
146
+
147
+ ### Tag Status Grup Audio
148
+
149
+ ```javascript
150
+ const quoted = m.quoted ? m.quoted : m;
151
+ const mime = (quoted.msg || quoted).mimetype || "";
152
+ const caption = m.body.replace(/^\.swgrup\s*/i, "").trim();
153
+ const jid = m.chat;
154
+ if (/audio/.test(mime)) {
155
+ const buffer = await quoted.download();
156
+ await client.sendMessage(groupId, {
157
+ groupStatusMessage: {
158
+ audio: buffer,
159
+ }
160
+ });
161
+ ```
162
+
163
+ ### Album Message (Multiple Images)
164
+ Mengirim banyak gambar dalam satu pesan album:
165
+
166
+ ```javascript
167
+ await client.sendMessage(m.chat, {
168
+ albumMessage: [
169
+ { image: omak, caption: "Foto pertama" },
170
+ { image: { url: "URL IMAGE" }, caption: "Foto kedua" }
171
+ ]
172
+ }, { quoted: m });
173
+ ```
174
+
175
+ ### Event Message
176
+ Membuat dan mengirim undangan event WhatsApp:
177
+
178
+ ```javascript
179
+ await client.sendMessage(m.chat, {
180
+ eventMessage: {
181
+ isCanceled: false,
182
+ name: "Hello World",
183
+ description: "ravage native",
184
+ location: {
185
+ degreesLatitude: 0,
186
+ degreesLongitude: 0,
187
+ name: "rowrrrr"
188
+ },
189
+ joinLink: "https://call.whatsapp.com/video/daffadevv",
190
+ startTime: "1763019000",
191
+ endTime: "1763026200",
192
+ extraGuestsAllowed: false
193
+ }
194
+ }, { quoted: m });
195
+ ```
196
+
197
+ ### Poll Result Message
198
+ Menampilkan hasil polling beserta jumlah vote:
199
+
200
+ ```javascript
201
+ await client.sendMessage(m.chat, {
202
+ pollResultMessage: {
203
+ name: "Hello World",
204
+ pollVotes: [
205
+ {
206
+ optionName: "TEST 1",
207
+ optionVoteCount: "112233"
208
+ },
209
+ {
210
+ optionName: "TEST 2",
211
+ optionVoteCount: "1"
212
+ }
213
+ ]
214
+ }
215
+ }, { quoted: m });
216
+ ```
217
+
218
+ ### Simple Interactive Message
219
+ Mengirim pesan interaktif dasar dengan tombol salin:
220
+
221
+ ```javascript
222
+ await client.sendMessage(m.chat, {
223
+ interactiveMessage: {
224
+ header: "Hello World",
225
+ title: "Hello World",
226
+ footer: "telegram: @daffadevv ",
227
+ buttons: [
228
+ {
229
+ name: "cta_copy",
230
+ buttonParamsJson: JSON.stringify({
231
+ display_text: "copy code",
232
+ id: "123456789",
233
+ copy_code: "ABC123XYZ"
234
+ })
235
+ }
236
+ ]
237
+ }
238
+ }, { quoted: m });
239
+ ```
240
+
241
+ ### Interactive Message dengan Native Flow
242
+ Mengirim pesan interaktif dengan tombol dan fitur native flow:
243
+
244
+ ```javascript
245
+ await client.sendMessage(m.chat, {
246
+ interactiveMessage: {
247
+ header: "Hello World",
248
+ title: "Hello World",
249
+ footer: "telegram: @daffadevv",
250
+ image: { url: "https://example.com/image.jpg" },
251
+ nativeFlowMessage: {
252
+ messageParamsJson: JSON.stringify({
253
+ limited_time_offer: {
254
+ text: "idk hummmm?",
255
+ url: "https://t.me/daffadevv",
256
+ copy_code: "ravage",
257
+ expiration_time: Date.now() * 999
258
+ },
259
+ bottom_sheet: {
260
+ in_thread_buttons_limit: 2,
261
+ divider_indices: [1, 2, 3, 4, 5, 999],
262
+ list_title: "ravage native",
263
+ button_title: "ravage native"
264
+ },
265
+ tap_target_configuration: {
266
+ title: " X ",
267
+ description: "bomboclard",
268
+ canonical_url: "https://t.me/daffadevv",
269
+ domain: "shop.example.com",
270
+ button_index: 0
271
+ }
272
+ }),
273
+ buttons: [
274
+ {
275
+ name: "single_select",
276
+ buttonParamsJson: JSON.stringify({
277
+ has_multiple_buttons: true
278
+ })
279
+ },
280
+ {
281
+ name: "call_permission_request",
282
+ buttonParamsJson: JSON.stringify({
283
+ has_multiple_buttons: true
284
+ })
285
+ },
286
+ {
287
+ name: "single_select",
288
+ buttonParamsJson: JSON.stringify({
289
+ title: "Hello World",
290
+ sections: [
291
+ {
292
+ title: "title",
293
+ highlight_label: "label",
294
+ rows: [
295
+ {
296
+ title: "@daffadevv",
297
+ description: "love you",
298
+ id: "row_2"
299
+ }
300
+ ]
301
+ }
302
+ ],
303
+ has_multiple_buttons: true
304
+ })
305
+ },
306
+ {
307
+ name: "cta_copy",
308
+ buttonParamsJson: JSON.stringify({
309
+ display_text: "copy code",
310
+ id: "123456789",
311
+ copy_code: "ABC123XYZ"
312
+ })
313
+ }
314
+ ]
315
+ }
316
+ }
317
+ }, { quoted: m });
318
+ ```
319
+
320
+ ### Interactive Message dengan Thumbnail
321
+ Mengirim pesan interaktif dengan thumbnail dan tombol salin:
322
+
323
+ ```javascript
324
+ await client.sendMessage(m.chat, {
325
+ interactiveMessage: {
326
+ header: "Hello World",
327
+ title: "Hello World",
328
+ footer: "telegram: @daffadevv",
329
+ image: { url: "https://example.com/image.jpg" },
330
+ buttons: [
331
+ {
332
+ name: "cta_copy",
333
+ buttonParamsJson: JSON.stringify({
334
+ display_text: "copy code",
335
+ id: "123456789",
336
+ copy_code: "ABC123XYZ"
337
+ })
338
+ }
339
+ ]
340
+ }
341
+ }, { quoted: m });
342
+ ```
343
+
344
+ ### Product Message
345
+ Mengirim pesan katalog produk dengan tombol dan info merchant:
346
+
347
+ ```javascript
348
+ await client.sendMessage(m.chat, {
349
+ productMessage: {
350
+ title: "Produk Contoh",
351
+ description: "Ini adalah deskripsi produk",
352
+ thumbnail: { url: "https://example.com/image.jpg" },
353
+ productId: "PROD001",
354
+ retailerId: "RETAIL001",
355
+ url: "https://example.com/product",
356
+ body: "Detail produk",
357
+ footer: "Harga spesial",
358
+ priceAmount1000: 50000,
359
+ currencyCode: "USD",
360
+ buttons: [
361
+ {
362
+ name: "cta_url",
363
+ buttonParamsJson: JSON.stringify({
364
+ display_text: "Beli Sekarang",
365
+ url: "https://example.com/buy"
366
+ })
367
+ }
368
+ ]
369
+ }
370
+ }, { quoted: m });
371
+ ```
372
+
373
+ ### Interactive Message dengan Document Buffer
374
+ Mengirim pesan interaktif dengan dokumen dari buffer (file system) — **Catatan: Dokumen hanya mendukung buffer**:
375
+
376
+ ```javascript
377
+ await client.sendMessage(m.chat, {
378
+ interactiveMessage: {
379
+ header: "Hello World",
380
+ title: "Hello World",
381
+ footer: "telegram: @daffadevv",
382
+ document: fs.readFileSync("./package.json"),
383
+ mimetype: "application/pdf",
384
+ fileName: "daffadevv.pdf",
385
+ jpegThumbnail: fs.readFileSync("./document.jpeg"),
386
+ contextInfo: {
387
+ mentionedJid: [m.chat],
388
+ forwardingScore: 777,
389
+ isForwarded: false
390
+ },
391
+ externalAdReply: {
392
+ title: "Ravage",
393
+ body: "",
394
+ mediaType: 3,
395
+ thumbnailUrl: "https://example.com/image.jpg",
396
+ mediaUrl: " X ",
397
+ sourceUrl: "https://t.me/daffadevv",
398
+ showAdAttribution: true,
399
+ renderLargerThumbnail: false
400
+ },
401
+ buttons: [
402
+ {
403
+ name: "cta_url",
404
+ buttonParamsJson: JSON.stringify({
405
+ display_text: "Telegram",
406
+ url: "https://t.me/daffadevv",
407
+ merchant_url: "https://t.me/daffadevv"
408
+ })
409
+ }
410
+ ]
411
+ }
412
+ }, { quoted: m });
413
+ ```
414
+
415
+ ### Interactive Message dengan Document Buffer (Simple)
416
+ Mengirim pesan interaktif dengan dokumen dari buffer tanpa contextInfo dan externalAdReply — **Catatan: Dokumen hanya mendukung buffer**:
417
+
418
+ ```javascript
419
+ await client.sendMessage(m.chat, {
420
+ interactiveMessage: {
421
+ header: "Hello World",
422
+ title: "Hello World",
423
+ footer: "telegram: @daffadevv",
424
+ document: fs.readFileSync("./package.json"),
425
+ mimetype: "application/pdf",
426
+ fileName: "daffadevv.pdf",
427
+ jpegThumbnail: fs.readFileSync("./document.jpeg"),
428
+ buttons: [
429
+ {
430
+ name: "cta_url",
431
+ buttonParamsJson: JSON.stringify({
432
+ display_text: "Telegram",
433
+ url: "https://t.me/daffadevv",
434
+ merchant_url: "https://t.me/daffadevv"
435
+ })
436
+ }
437
+ ]
438
+ }
439
+ }, { quoted: m });
440
+ ```
441
+
442
+ ### Request Payment Message
443
+ Mengirim pesan permintaan pembayaran dengan background dan sticker kustom:
444
+
445
+ ```javascript
446
+ let quotedType = m.quoted?.mtype || '';
447
+ let quotedContent = JSON.stringify({ [quotedType]: m.quoted }, null, 2);
448
+
449
+ await client.sendMessage(m.chat, {
450
+ requestPaymentMessage: {
451
+ currency: "IDR",
452
+ amount: 10000000,
453
+ from: m.sender,
454
+ sticker: JSON.parse(quotedContent),
455
+ background: {
456
+ id: "100",
457
+ fileLength: "0",
458
+ width: 1000,
459
+ height: 1000,
460
+ mimetype: "image/webp",
461
+ placeholderArgb: 0xFF00FFFF,
462
+ textArgb: 0xFFFFFFFF,
463
+ subtextArgb: 0xFFAA00FF
464
+ }
465
+ }
466
+ }, { quoted: m });
467
+ ```
468
+
469
+ ---
470
+
471
+ ## Mengapa Memilih WhatsApp Baileys?
472
+
473
+ Karena library ini menawarkan stabilitas tinggi, fitur lengkap, dan proses pairing yang terus ditingkatkan. Ideal bagi developer yang ingin membuat solusi otomatisasi WhatsApp yang profesional dan aman. Dukungan terhadap fitur terbaru WhatsApp memastikan kompatibilitas dengan pembaruan platform.
474
+
475
+ ---
476
+
477
+ ### Catatan Teknis
478
+
479
+ - Mendukung pairing code kustom yang stabil dan aman
480
+ - Memperbaiki masalah terkait pairing dan autentikasi pada versi sebelumnya
481
+ - Fitur pesan interaktif dan tombol aksi untuk membuat menu dinamis
482
+ - Manajemen sesi otomatis yang efisien untuk stabilitas jangka panjang
483
+ - Kompatibel dengan fitur multi-device terbaru WhatsApp
484
+ - Mudah diintegrasikan dan dikustomisasi sesuai kebutuhan
485
+ - Sempurna untuk mengembangkan bot, otomatisasi layanan pelanggan, dan aplikasi komunikasi lainnya
486
+
487
+ ---
488
+
489
+ Untuk dokumentasi lengkap, panduan instalasi, dan contoh implementasi, silakan kunjungi repository resmi dan forum komunitas. Kami terus memperbarui dan meningkatkan library ini untuk memenuhi kebutuhan developer dan pengguna solusi otomatisasi WhatsApp modern.
490
+
491
+ **Terima kasih telah memilih WhatsApp Baileys sebagai solusi otomatisasi WhatsApp Anda!**