neuralwhatsapp 1.0.0 → 1.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.
package/README.md CHANGED
@@ -46,19 +46,25 @@ Begin by installing the library via your preferred package manager, then follow
46
46
  ## Add Function ( Simple code )
47
47
 
48
48
  ### Label Group
49
+
49
50
  Tag/Label Member Grop
50
51
 
51
52
  ```javascript
52
- sock.setLabelGroup(jid, string)
53
+ sock.setLabelGroup(jid, string);
53
54
  ```
55
+
54
56
  ---
55
- ### Check ID Channel
57
+
58
+ ### Check ID Channel
59
+
56
60
  Get ID Channel From Url
57
61
 
58
62
  ```javascript
59
- sock.newsletterFromUrl(url)
63
+ sock.newsletterFromUrl(url);
60
64
  ```
65
+
61
66
  Result JSON
67
+
62
68
  ```json
63
69
  {
64
70
  "name": "Name Channel",
@@ -70,18 +76,23 @@ Result JSON
70
76
  "description": "Description Channel"
71
77
  }
72
78
  ```
79
+
73
80
  ---
81
+
74
82
  ### Check banned number
75
- You can see the status of blocked numbers here
83
+
84
+ You can see the status of blocked numbers here
76
85
 
77
86
  ```javascript
78
- sock.checkWhatsApp(jid)
87
+ sock.checkWhatsApp(jid);
79
88
  ```
89
+
80
90
  ---
81
91
 
82
92
  ## SendMessage Documentation
83
93
 
84
94
  ### Status Mention Group & Private Message
95
+
85
96
  Send Status Mention Group/Private Chat
86
97
 
87
98
  ```javascript
@@ -89,320 +100,371 @@ await sock.sendStatusMention(content, jid);
89
100
  ```
90
101
 
91
102
  ### Status Group Message V2
92
- Send Group Status With Version 2
103
+
104
+ Send Group Status With Version 2
93
105
 
94
106
  ```javascript
95
107
  await sock.sendMessage(jid, {
96
- groupStatusMessage: {
97
- text: "Hello World"
98
- }
108
+ groupStatusMessage: {
109
+ text: "Hello World",
110
+ },
99
111
  });
100
112
  ```
101
113
 
102
114
  ### Album Message (Multiple Images)
115
+
103
116
  Send multiple images in a single album message:
104
117
 
105
118
  ```javascript
106
- await sock.sendMessage(jid, {
119
+ await sock.sendMessage(
120
+ jid,
121
+ {
107
122
  albumMessage: [
108
- { image: haii, caption: "Foto pertama" },
109
- { image: { url: "URL IMAGE" }, caption: "Foto kedua" }
110
- ]
111
- }, { quoted: m });
123
+ { image: haii, caption: "Foto pertama" },
124
+ { image: { url: "URL IMAGE" }, caption: "Foto kedua" },
125
+ ],
126
+ },
127
+ { quoted: m },
128
+ );
112
129
  ```
113
130
 
114
131
  ### Event Message
132
+
115
133
  Create and send WhatsApp event invitations:
116
134
 
117
135
  ```javascript
118
- await sock.sendMessage(jid, {
119
- eventMessage: {
120
- isCanceled: false,
121
- name: "Hello World",
122
- description: "neural",
123
- location: {
124
- degreesLatitude: 0,
125
- degreesLongitude: 0,
126
- name: "rowrrrr"
127
- },
128
- joinLink: "https://call.whatsapp.com/video/neural",
129
- startTime: "1763019000",
130
- endTime: "1763026200",
131
- extraGuestsAllowed: false
132
- }
133
- }, { quoted: m });
136
+ await sock.sendMessage(
137
+ jid,
138
+ {
139
+ eventMessage: {
140
+ isCanceled: false,
141
+ name: "Hello World",
142
+ description: "neural",
143
+ location: {
144
+ degreesLatitude: 0,
145
+ degreesLongitude: 0,
146
+ name: "rowrrrr",
147
+ },
148
+ joinLink: "https://call.whatsapp.com/video/neural",
149
+ startTime: "1763019000",
150
+ endTime: "1763026200",
151
+ extraGuestsAllowed: false,
152
+ },
153
+ },
154
+ { quoted: m },
155
+ );
134
156
  ```
135
157
 
136
158
  ### Poll Result Message
159
+
137
160
  Display poll results with vote counts:
138
161
 
139
162
  ```javascript
140
- await sock.sendMessage(jid, {
141
- pollResultMessage: {
142
- name: "Hello World",
143
- pollVotes: [
144
- {
145
- optionName: "TEST 1",
146
- optionVoteCount: "112233"
147
- },
148
- {
149
- optionName: "TEST 2",
150
- optionVoteCount: "1"
151
- }
152
- ]
153
- }
154
- }, { quoted: m });
163
+ await sock.sendMessage(
164
+ jid,
165
+ {
166
+ pollResultMessage: {
167
+ name: "Hello World",
168
+ pollVotes: [
169
+ {
170
+ optionName: "TEST 1",
171
+ optionVoteCount: "112233",
172
+ },
173
+ {
174
+ optionName: "TEST 2",
175
+ optionVoteCount: "1",
176
+ },
177
+ ],
178
+ },
179
+ },
180
+ { quoted: m },
181
+ );
155
182
  ```
156
183
 
157
184
  ### Simple Interactive Message
185
+
158
186
  Send basic interactive messages with copy button functionality:
159
187
 
160
188
  ```javascript
161
- await sock.sendMessage(jid, {
189
+ await sock.sendMessage(
190
+ jid,
191
+ {
162
192
  interactiveMessage: {
163
- header: "Hello World",
164
- title: "Hello World",
165
- footer: "telegram: @hanabylm ",
166
- buttons: [
167
- {
168
- name: "cta_copy",
169
- buttonParamsJson: JSON.stringify({
170
- display_text: "copy code",
171
- id: "123456789",
172
- copy_code: "ABC123XYZ"
173
- })
174
- }
175
- ]
176
- }
177
- }, { quoted: m });
193
+ header: "Hello World",
194
+ title: "Hello World",
195
+ footer: "telegram: @hanabylm ",
196
+ buttons: [
197
+ {
198
+ name: "cta_copy",
199
+ buttonParamsJson: JSON.stringify({
200
+ display_text: "copy code",
201
+ id: "123456789",
202
+ copy_code: "ABC123XYZ",
203
+ }),
204
+ },
205
+ ],
206
+ },
207
+ },
208
+ { quoted: m },
209
+ );
178
210
  ```
179
211
 
180
212
  ### Interactive Message with Native Flow
213
+
181
214
  Send interactive messages with buttons, copy actions, and native flow features:
182
215
 
183
216
  ```javascript
184
- await sock.sendMessage(jid, {
185
- interactiveMessage: {
186
- header: "Hello World",
187
- title: "Hello World",
188
- footer: "telegram: @hanabylm",
189
- image: { url: "https://example.com/image.jpg" },
190
- nativeFlowMessage: {
191
- messageParamsJson: JSON.stringify({
192
- limited_time_offer: {
193
- text: "idk hummmm?",
194
- url: "https://t.me/hanabylm",
195
- copy_code: "neural",
196
- expiration_time: Date.now() * 999
197
- },
198
- bottom_sheet: {
199
- in_thread_buttons_limit: 2,
200
- divider_indices: [1, 2, 3, 4, 5, 999],
201
- list_title: "neural",
202
- button_title: "neural"
203
- },
204
- tap_target_configuration: {
205
- title: " X ",
206
- description: "bomboclard",
207
- canonical_url: "https://t.me/neural",
208
- domain: "shop.example.com",
209
- button_index: 0
210
- }
211
- }),
212
- buttons: [
213
- {
214
- name: "single_select",
215
- buttonParamsJson: JSON.stringify({
216
- has_multiple_buttons: true
217
- })
218
- },
219
- {
220
- name: "call_permission_request",
221
- buttonParamsJson: JSON.stringify({
222
- has_multiple_buttons: true
223
- })
224
- },
225
- {
226
- name: "single_select",
227
- buttonParamsJson: JSON.stringify({
228
- title: "Hello World",
229
- sections: [
230
- {
231
- title: "title",
232
- highlight_label: "label",
233
- rows: [
234
- {
235
- title: "@neural",
236
- description: "love you",
237
- id: "row_2"
238
- }
239
- ]
240
- }
241
- ],
242
- has_multiple_buttons: true
243
- })
244
- },
245
- {
246
- name: "cta_copy",
247
- buttonParamsJson: JSON.stringify({
248
- display_text: "copy code",
249
- id: "123456789",
250
- copy_code: "ABC123XYZ"
251
- })
252
- }
253
- ]
254
- }
255
- }
256
- }, { quoted: m });
217
+ await sock.sendMessage(
218
+ jid,
219
+ {
220
+ interactiveMessage: {
221
+ header: "Hello World",
222
+ title: "Hello World",
223
+ footer: "telegram: @hanabylm",
224
+ image: { url: "https://example.com/image.jpg" },
225
+ nativeFlowMessage: {
226
+ messageParamsJson: JSON.stringify({
227
+ limited_time_offer: {
228
+ text: "idk hummmm?",
229
+ url: "https://t.me/hanabylm",
230
+ copy_code: "neural",
231
+ expiration_time: Date.now() * 999,
232
+ },
233
+ bottom_sheet: {
234
+ in_thread_buttons_limit: 2,
235
+ divider_indices: [1, 2, 3, 4, 5, 999],
236
+ list_title: "neural",
237
+ button_title: "neural",
238
+ },
239
+ tap_target_configuration: {
240
+ title: " X ",
241
+ description: "bomboclard",
242
+ canonical_url: "https://t.me/neural",
243
+ domain: "shop.example.com",
244
+ button_index: 0,
245
+ },
246
+ }),
247
+ buttons: [
248
+ {
249
+ name: "single_select",
250
+ buttonParamsJson: JSON.stringify({
251
+ has_multiple_buttons: true,
252
+ }),
253
+ },
254
+ {
255
+ name: "call_permission_request",
256
+ buttonParamsJson: JSON.stringify({
257
+ has_multiple_buttons: true,
258
+ }),
259
+ },
260
+ {
261
+ name: "single_select",
262
+ buttonParamsJson: JSON.stringify({
263
+ title: "Hello World",
264
+ sections: [
265
+ {
266
+ title: "title",
267
+ highlight_label: "label",
268
+ rows: [
269
+ {
270
+ title: "@neural",
271
+ description: "love you",
272
+ id: "row_2",
273
+ },
274
+ ],
275
+ },
276
+ ],
277
+ has_multiple_buttons: true,
278
+ }),
279
+ },
280
+ {
281
+ name: "cta_copy",
282
+ buttonParamsJson: JSON.stringify({
283
+ display_text: "copy code",
284
+ id: "123456789",
285
+ copy_code: "ABC123XYZ",
286
+ }),
287
+ },
288
+ ],
289
+ },
290
+ },
291
+ },
292
+ { quoted: m },
293
+ );
257
294
  ```
258
295
 
259
296
  ### Interactive Message with Thumbnail
297
+
260
298
  Send interactive messages with thumbnail image and copy button:
261
299
 
262
300
  ```javascript
263
- await sock.sendMessage(jid, {
301
+ await sock.sendMessage(
302
+ jid,
303
+ {
264
304
  interactiveMessage: {
265
- header: "Hello World",
266
- title: "Hello World",
267
- footer: "telegram: @hanabylm",
268
- image: { url: "https://example.com/image.jpg" },
269
- buttons: [
270
- {
271
- name: "cta_copy",
272
- buttonParamsJson: JSON.stringify({
273
- display_text: "copy code",
274
- id: "123456789",
275
- copy_code: "ABC123XYZ"
276
- })
277
- }
278
- ]
279
- }
280
- }, { quoted: m });
305
+ header: "Hello World",
306
+ title: "Hello World",
307
+ footer: "telegram: @hanabylm",
308
+ image: { url: "https://example.com/image.jpg" },
309
+ buttons: [
310
+ {
311
+ name: "cta_copy",
312
+ buttonParamsJson: JSON.stringify({
313
+ display_text: "copy code",
314
+ id: "123456789",
315
+ copy_code: "ABC123XYZ",
316
+ }),
317
+ },
318
+ ],
319
+ },
320
+ },
321
+ { quoted: m },
322
+ );
281
323
  ```
282
324
 
283
325
  ### Product Message
326
+
284
327
  Send product catalog messages with buttons and merchant information:
285
328
 
286
329
  ```javascript
287
- await sock.sendMessage(jid, {
330
+ await sock.sendMessage(
331
+ jid,
332
+ {
288
333
  productMessage: {
289
- title: "Produk Contoh",
290
- description: "Ini adalah deskripsi produk",
291
- thumbnail: { url: "https://example.com/image.jpg" },
292
- productId: "PROD001",
293
- retailerId: "RETAIL001",
294
- url: "https://example.com/product",
295
- body: "Detail produk",
296
- footer: "Harga spesial",
297
- priceAmount1000: 50000,
298
- currencyCode: "USD",
299
- buttons: [
300
- {
301
- name: "cta_url",
302
- buttonParamsJson: JSON.stringify({
303
- display_text: "Beli Sekarang",
304
- url: "https://example.com/buy"
305
- })
306
- }
307
- ]
308
- }
309
- }, { quoted: m });
334
+ title: "Produk Contoh",
335
+ description: "Ini adalah deskripsi produk",
336
+ thumbnail: { url: "https://example.com/image.jpg" },
337
+ productId: "PROD001",
338
+ retailerId: "RETAIL001",
339
+ url: "https://example.com/product",
340
+ body: "Detail produk",
341
+ footer: "Harga spesial",
342
+ priceAmount1000: 50000,
343
+ currencyCode: "USD",
344
+ buttons: [
345
+ {
346
+ name: "cta_url",
347
+ buttonParamsJson: JSON.stringify({
348
+ display_text: "Beli Sekarang",
349
+ url: "https://example.com/buy",
350
+ }),
351
+ },
352
+ ],
353
+ },
354
+ },
355
+ { quoted: m },
356
+ );
310
357
  ```
311
358
 
312
359
  ### Interactive Message with Document Buffer
360
+
313
361
  Send interactive messages with document from buffer (file system) - **Note: Documents only support buffer**:
314
362
 
315
363
  ```javascript
316
- await sock.sendMessage(jid, {
364
+ await sock.sendMessage(
365
+ jid,
366
+ {
317
367
  interactiveMessage: {
318
- header: "Hello World",
319
- title: "Hello World",
320
- footer: "telegram: @hanabylm",
321
- document: fs.readFileSync("./package.json"),
322
- mimetype: "application/pdf",
323
- fileName: "neural.pdf",
324
- jpegThumbnail: fs.readFileSync("./document.jpeg"),
325
- contextInfo: {
326
- mentionedJid: [jid],
327
- forwardingScore: 777,
328
- isForwarded: false
329
- },
330
- externalAdReply: {
331
- title: "shenń Bot",
332
- body: "anu team",
333
- mediaType: 3,
334
- thumbnailUrl: "https://example.com/image.jpg",
335
- mediaUrl: " X ",
336
- sourceUrl: "https://t.me/hanabylm",
337
- showAdAttribution: true,
338
- renderLargerThumbnail: false
368
+ header: "Hello World",
369
+ title: "Hello World",
370
+ footer: "telegram: @hanabylm",
371
+ document: fs.readFileSync("./package.json"),
372
+ mimetype: "application/pdf",
373
+ fileName: "neural.pdf",
374
+ jpegThumbnail: fs.readFileSync("./document.jpeg"),
375
+ contextInfo: {
376
+ mentionedJid: [jid],
377
+ forwardingScore: 777,
378
+ isForwarded: false,
379
+ },
380
+ externalAdReply: {
381
+ title: "shenń Bot",
382
+ body: "anu team",
383
+ mediaType: 3,
384
+ thumbnailUrl: "https://example.com/image.jpg",
385
+ mediaUrl: " X ",
386
+ sourceUrl: "https://t.me/hanabylm",
387
+ showAdAttribution: true,
388
+ renderLargerThumbnail: false,
389
+ },
390
+ buttons: [
391
+ {
392
+ name: "cta_url",
393
+ buttonParamsJson: JSON.stringify({
394
+ display_text: "Telegram",
395
+ url: "https://t.me/hanabylm",
396
+ merchant_url: "https://t.me/hanabylm",
397
+ }),
339
398
  },
340
- buttons: [
341
- {
342
- name: "cta_url",
343
- buttonParamsJson: JSON.stringify({
344
- display_text: "Telegram",
345
- url: "https://t.me/hanabylm",
346
- merchant_url: "https://t.me/hanabylm"
347
- })
348
- }
349
- ]
350
- }
351
- }, { quoted: m });
399
+ ],
400
+ },
401
+ },
402
+ { quoted: m },
403
+ );
352
404
  ```
353
405
 
354
406
  ### Interactive Message with Document Buffer (Simple)
407
+
355
408
  Send interactive messages with document from buffer (file system) without contextInfo and externalAdReply - **Note: Documents only support buffer**:
356
409
 
357
410
  ```javascript
358
- await sock.sendMessage(jid, {
411
+ await sock.sendMessage(
412
+ jid,
413
+ {
359
414
  interactiveMessage: {
360
- header: "Hello World",
361
- title: "Hello World",
362
- footer: "telegram: @hanabylm",
363
- document: fs.readFileSync("./package.json"),
364
- mimetype: "application/pdf",
365
- fileName: "neural.pdf",
366
- jpegThumbnail: fs.readFileSync("./document.jpeg"),
367
- buttons: [
368
- {
369
- name: "cta_url",
370
- buttonParamsJson: JSON.stringify({
371
- display_text: "Telegram",
372
- url: "https://t.me/hanabylm",
373
- merchant_url: "https://t.me/hanabylm"
374
- })
375
- }
376
- ]
377
- }
378
- }, { quoted: m });
415
+ header: "Hello World",
416
+ title: "Hello World",
417
+ footer: "telegram: @hanabylm",
418
+ document: fs.readFileSync("./package.json"),
419
+ mimetype: "application/pdf",
420
+ fileName: "neural.pdf",
421
+ jpegThumbnail: fs.readFileSync("./document.jpeg"),
422
+ buttons: [
423
+ {
424
+ name: "cta_url",
425
+ buttonParamsJson: JSON.stringify({
426
+ display_text: "Telegram",
427
+ url: "https://t.me/hanabylm",
428
+ merchant_url: "https://t.me/hanabylm",
429
+ }),
430
+ },
431
+ ],
432
+ },
433
+ },
434
+ { quoted: m },
435
+ );
379
436
  ```
380
437
 
381
438
  ### Request Payment Message
439
+
382
440
  Send payment request messages with custom background and sticker:
383
441
 
384
442
  ```javascript
385
- let quotedType = m.quoted?.mtype || '';
443
+ let quotedType = m.quoted?.mtype || "";
386
444
  let quotedContent = JSON.stringify({ [quotedType]: m.quoted }, null, 2);
387
445
 
388
- await sock.sendMessage(jid, {
446
+ await sock.sendMessage(
447
+ jid,
448
+ {
389
449
  requestPaymentMessage: {
390
- currency: "IDR",
391
- amount: 10000000,
392
- from: m.sender,
393
- sticker: JSON.parse(quotedContent),
394
- background: {
395
- id: "100",
396
- fileLength: "0",
397
- width: 1000,
398
- height: 1000,
399
- mimetype: "image/webp",
400
- placeholderArgb: 0xFF00FFFF,
401
- textArgb: 0xFFFFFFFF,
402
- subtextArgb: 0xFFAA00FF
403
- }
404
- }
405
- }, { quoted: m });
450
+ currency: "IDR",
451
+ amount: 10000000,
452
+ from: m.sender,
453
+ sticker: JSON.parse(quotedContent),
454
+ background: {
455
+ id: "100",
456
+ fileLength: "0",
457
+ width: 1000,
458
+ height: 1000,
459
+ mimetype: "image/webp",
460
+ placeholderArgb: 0xff00ffff,
461
+ textArgb: 0xffffffff,
462
+ subtextArgb: 0xffaa00ff,
463
+ },
464
+ },
465
+ },
466
+ { quoted: m },
467
+ );
406
468
  ```
407
469
 
408
470
  ---
@@ -422,7 +484,7 @@ Because this library offers high stability, full features, and an actively impro
422
484
  - Compatible with the latest multi-device features from WhatsApp
423
485
  - Easy to integrate and customize based on your needs
424
486
  - Perfect for developing bots, customer service automation, and other communication applications
425
- - Has 1 newsletter follow, only the developer's WhatsApp channel: [WhatsApp Channel](https://whatsapp.com/channel/0029Vb3IiqTL7UVP9A9n0w1x)
487
+ - Has 1 newsletter follow, only the developer's WhatsApp channel: [WhatsApp Channel](https://whatsapp.com/channel/0029VbBv6cUInlqLc5H0Kw0K)
426
488
 
427
489
  ---
428
490
 
@@ -430,16 +492,14 @@ For complete documentation, installation guides, and implementation examples, pl
430
492
 
431
493
  **Thank you for choosing WhatsApp Baileys as your WhatsApp automation solution!**
432
494
 
433
-
434
495
  ---
435
496
 
436
-
437
497
  ### Contact Developer
438
498
 
439
499
  For questions, support, or collaboration, feel free to contact the developer:
440
500
 
441
501
  - **Telegram**: [Telegram Contact](https://t.me/hanabylm)
442
- - **Channel WhatsApp**: [Channel WhatsApp](https://whatsapp.com/channel/0029Vb3IiqTL7UVP9A9n0w1x)
502
+ - **Channel WhatsApp**: [Channel WhatsApp](https://whatsapp.com/channel/0029VbBv6cUInlqLc5H0Kw0K)
443
503
 
444
504
  ### 🙌 Contributors outside the Baileys code
445
505