@fvckerss/baileys 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +231 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,6 +50,7 @@ npm install @fvckerss/baileys
|
|
|
50
50
|
|
|
51
51
|
### 🚀 Basic Connection
|
|
52
52
|
|
|
53
|
+
```
|
|
53
54
|
const {
|
|
54
55
|
default: makeWASocket,
|
|
55
56
|
useMultiFileAuthState,
|
|
@@ -74,22 +75,26 @@ async function startBot() {
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
startBot()
|
|
78
|
+
```
|
|
77
79
|
|
|
78
80
|
---
|
|
79
81
|
|
|
80
82
|
### 💬 Send Text Message
|
|
81
83
|
|
|
84
|
+
```
|
|
82
85
|
await sock.sendMessage(
|
|
83
86
|
jid,
|
|
84
87
|
{
|
|
85
88
|
text: "Halo Dunia!"
|
|
86
89
|
}
|
|
87
90
|
)
|
|
91
|
+
```
|
|
88
92
|
|
|
89
93
|
---
|
|
90
94
|
|
|
91
95
|
### 🖼️ Send Image
|
|
92
96
|
|
|
97
|
+
```
|
|
93
98
|
await sock.sendMessage(
|
|
94
99
|
jid,
|
|
95
100
|
{
|
|
@@ -99,11 +104,13 @@ await sock.sendMessage(
|
|
|
99
104
|
caption: "Hello"
|
|
100
105
|
}
|
|
101
106
|
)
|
|
107
|
+
```
|
|
102
108
|
|
|
103
109
|
---
|
|
104
110
|
|
|
105
111
|
### 🎥 Send Video
|
|
106
112
|
|
|
113
|
+
```
|
|
107
114
|
await sock.sendMessage(
|
|
108
115
|
jid,
|
|
109
116
|
{
|
|
@@ -113,11 +120,13 @@ await sock.sendMessage(
|
|
|
113
120
|
caption: "Video Test"
|
|
114
121
|
}
|
|
115
122
|
)
|
|
123
|
+
```
|
|
116
124
|
|
|
117
125
|
---
|
|
118
126
|
|
|
119
127
|
### 🎵 Send Audio
|
|
120
128
|
|
|
129
|
+
```
|
|
121
130
|
await sock.sendMessage(
|
|
122
131
|
jid,
|
|
123
132
|
{
|
|
@@ -127,11 +136,13 @@ await sock.sendMessage(
|
|
|
127
136
|
mimetype: "audio/mpeg"
|
|
128
137
|
}
|
|
129
138
|
)
|
|
139
|
+
```
|
|
130
140
|
|
|
131
141
|
---
|
|
132
142
|
|
|
133
143
|
### 📄 Send Document
|
|
134
144
|
|
|
145
|
+
```
|
|
135
146
|
await sock.sendMessage(
|
|
136
147
|
jid,
|
|
137
148
|
{
|
|
@@ -142,11 +153,13 @@ await sock.sendMessage(
|
|
|
142
153
|
mimetype: "application/pdf"
|
|
143
154
|
}
|
|
144
155
|
)
|
|
156
|
+
```
|
|
145
157
|
|
|
146
158
|
---
|
|
147
159
|
|
|
148
160
|
### 📍 Send Location
|
|
149
161
|
|
|
162
|
+
```
|
|
150
163
|
await sock.sendMessage(
|
|
151
164
|
jid,
|
|
152
165
|
{
|
|
@@ -156,11 +169,13 @@ await sock.sendMessage(
|
|
|
156
169
|
}
|
|
157
170
|
}
|
|
158
171
|
)
|
|
172
|
+
```
|
|
159
173
|
|
|
160
174
|
---
|
|
161
175
|
|
|
162
176
|
### 👤 Send Contact
|
|
163
177
|
|
|
178
|
+
```
|
|
164
179
|
await sock.sendMessage(
|
|
165
180
|
jid,
|
|
166
181
|
{
|
|
@@ -179,34 +194,50 @@ END:VCARD`
|
|
|
179
194
|
}
|
|
180
195
|
}
|
|
181
196
|
)
|
|
197
|
+
```
|
|
182
198
|
|
|
183
199
|
---
|
|
184
200
|
|
|
185
201
|
### 📋 List Message
|
|
186
202
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
rows: [
|
|
203
|
+
```
|
|
204
|
+
await conn.sendMessage(m.chat, {
|
|
205
|
+
text: "Select group to ON/OFF auto typing",
|
|
206
|
+
footer: "FVCKERS",
|
|
207
|
+
buttons: [
|
|
193
208
|
{
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
209
|
+
buttonId: "typing_group_list",
|
|
210
|
+
buttonText: { displayText: "[ Select Group ]" },
|
|
211
|
+
type: 1,
|
|
212
|
+
nativeFlowInfo: {
|
|
213
|
+
name: "single_select",
|
|
214
|
+
paramsJson: JSON.stringify({
|
|
215
|
+
title: "List Group",
|
|
216
|
+
sections: [
|
|
217
|
+
{
|
|
218
|
+
title: "Group",
|
|
219
|
+
rows: [
|
|
220
|
+
{
|
|
221
|
+
title: `Button`,
|
|
222
|
+
description: `> Ini tampilan button`,
|
|
223
|
+
id: `listb`
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
})
|
|
229
|
+
}
|
|
200
230
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
231
|
+
],
|
|
232
|
+
headerType: 1
|
|
233
|
+
});
|
|
234
|
+
```
|
|
205
235
|
|
|
206
236
|
---
|
|
207
237
|
|
|
208
238
|
### 🔘 Buttons Message
|
|
209
239
|
|
|
240
|
+
```
|
|
210
241
|
await sock.sendMessage(jid, {
|
|
211
242
|
text: "Hello World",
|
|
212
243
|
buttons: [
|
|
@@ -224,34 +255,188 @@ await sock.sendMessage(jid, {
|
|
|
224
255
|
}
|
|
225
256
|
]
|
|
226
257
|
})
|
|
258
|
+
```
|
|
227
259
|
|
|
228
260
|
---
|
|
229
261
|
|
|
230
|
-
### ⚡
|
|
262
|
+
### ⚡ InteractiveMessage NativeFlowMessage With Thumbnail
|
|
231
263
|
|
|
232
|
-
|
|
233
|
-
|
|
264
|
+
```
|
|
265
|
+
const img = await generateWAMessageContent(
|
|
266
|
+
{ image: { url: "https://upload.fvckers.my.id/y1z56qmqj90wv8.jpg" }},
|
|
267
|
+
{ upload: sock.waUploadToServer }
|
|
268
|
+
);
|
|
269
|
+
const msg = generateWAMessageFromContent(
|
|
270
|
+
m.chat,
|
|
234
271
|
{
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
272
|
+
viewOnceMessageV2: {
|
|
273
|
+
message: {
|
|
274
|
+
interactiveMessage: {
|
|
275
|
+
header: {
|
|
276
|
+
hasMediaAttachment: true,
|
|
277
|
+
imageMessage: img.imageMessage
|
|
278
|
+
},
|
|
279
|
+
body: {
|
|
280
|
+
text: "Hallo"
|
|
281
|
+
},
|
|
282
|
+
footer: {
|
|
283
|
+
text: "test"
|
|
284
|
+
},
|
|
285
|
+
contextInfo: {
|
|
286
|
+
mentionedJid: [m.sender],
|
|
287
|
+
forwardingScore: 7,
|
|
288
|
+
isForwarded: true,
|
|
289
|
+
forwardedNewsletterMessageInfo: {
|
|
290
|
+
newsletterName: `Fvckers`,
|
|
291
|
+
newsletterJid: `1@newsletter`
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
nativeFlowMessage: {
|
|
295
|
+
messageParamsJson: JSON.stringify({
|
|
296
|
+
limited_time_offer: {
|
|
297
|
+
text: "FVCKERS",
|
|
298
|
+
url: "http://swiper.my.id",
|
|
299
|
+
copy_code: "Fvckers",
|
|
300
|
+
expiration_time: Date.now() + 86400000
|
|
301
|
+
},
|
|
302
|
+
bottom_sheet: {
|
|
303
|
+
in_thread_buttons_limit: 1,
|
|
304
|
+
divider_indices: [1, 2, 3, 4, 5, 999],
|
|
305
|
+
list_title: "List Menu",
|
|
306
|
+
button_title: "List Menu"
|
|
307
|
+
},
|
|
308
|
+
tap_target_configuration: {
|
|
309
|
+
title: " X ",
|
|
310
|
+
description: "bomboclard",
|
|
311
|
+
canonical_url: "https://swiper.my.id",
|
|
312
|
+
domain: "shop.example.com",
|
|
313
|
+
button_index: 0
|
|
314
|
+
}
|
|
315
|
+
}),
|
|
316
|
+
buttons: [
|
|
317
|
+
{
|
|
318
|
+
name: "single_select",
|
|
319
|
+
buttonParamsJson: JSON.stringify({
|
|
320
|
+
has_multiple_buttons: true
|
|
321
|
+
})
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
name: "single_select",
|
|
325
|
+
buttonParamsJson: JSON.stringify({
|
|
326
|
+
title: "Menu Bagian 1",
|
|
327
|
+
sections: [
|
|
328
|
+
{
|
|
329
|
+
title: "",
|
|
330
|
+
highlight_label: "",
|
|
331
|
+
rows: [
|
|
332
|
+
{
|
|
333
|
+
title: "Menu 1",
|
|
334
|
+
description: "> Menu 1",
|
|
335
|
+
id: "menu1"
|
|
336
|
+
}
|
|
337
|
+
]
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
title: "",
|
|
341
|
+
highlight_label: "",
|
|
342
|
+
rows: [
|
|
343
|
+
{
|
|
344
|
+
title: "Menu 2",
|
|
345
|
+
description: "> Menu2",
|
|
346
|
+
id: "menu2"
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
title: "",
|
|
352
|
+
highlight_label: "",
|
|
353
|
+
rows: [
|
|
354
|
+
{
|
|
355
|
+
title: "Menu 3",
|
|
356
|
+
description: "> Menu 3",
|
|
357
|
+
id: "menu3"
|
|
358
|
+
}
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
],
|
|
362
|
+
has_multiple_buttons: true
|
|
363
|
+
})
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
name: "single_select",
|
|
367
|
+
buttonParamsJson: JSON.stringify({
|
|
368
|
+
title: "Menu Bagian 2",
|
|
369
|
+
sections: [
|
|
370
|
+
{
|
|
371
|
+
title: "",
|
|
372
|
+
highlight_label: "",
|
|
373
|
+
rows: [
|
|
374
|
+
{
|
|
375
|
+
title: "Menu 1",
|
|
376
|
+
description: "> Menu 1",
|
|
377
|
+
id: "menu1"
|
|
378
|
+
}
|
|
379
|
+
]
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
title: "",
|
|
383
|
+
highlight_label: "",
|
|
384
|
+
rows: [
|
|
385
|
+
{
|
|
386
|
+
title: "Menu 2",
|
|
387
|
+
description: "> Menu 2",
|
|
388
|
+
id: "menu2"
|
|
389
|
+
}
|
|
390
|
+
]
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
title: "",
|
|
394
|
+
highlight_label: "",
|
|
395
|
+
rows: [
|
|
396
|
+
{
|
|
397
|
+
title: "Menu 3",
|
|
398
|
+
description: "> Menu 3",
|
|
399
|
+
id: "menu3"
|
|
400
|
+
}
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
],
|
|
404
|
+
has_multiple_buttons: true
|
|
405
|
+
})
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
name: "cta_url",
|
|
409
|
+
buttonParamsJson: JSON.stringify({
|
|
410
|
+
display_text: "[ My Owner ]",
|
|
411
|
+
url: "https://wa.me/62812345678"
|
|
412
|
+
})
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: "cta_url",
|
|
416
|
+
buttonParamsJson: JSON.stringify({
|
|
417
|
+
display_text: "[ My Website ]",
|
|
418
|
+
url: "https://swiper.my.id"
|
|
419
|
+
})
|
|
420
|
+
}
|
|
421
|
+
]
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
240
426
|
},
|
|
241
|
-
{
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
]
|
|
249
|
-
}
|
|
427
|
+
{ quoted: m }
|
|
428
|
+
);
|
|
429
|
+
|
|
430
|
+
await sock.relayMessage(m.chat, msg.message, {
|
|
431
|
+
messageId: msg.key.id
|
|
432
|
+
});
|
|
433
|
+
```
|
|
250
434
|
|
|
251
435
|
---
|
|
252
436
|
|
|
253
437
|
### 📊 Create Poll
|
|
254
438
|
|
|
439
|
+
```
|
|
255
440
|
await sock.sendMessage(jid, {
|
|
256
441
|
poll: {
|
|
257
442
|
name: "Pilih Bahasa",
|
|
@@ -263,6 +448,7 @@ await sock.sendMessage(jid, {
|
|
|
263
448
|
selectableCount: 1
|
|
264
449
|
}
|
|
265
450
|
})
|
|
451
|
+
```
|
|
266
452
|
|
|
267
453
|
---
|
|
268
454
|
|
|
@@ -270,19 +456,23 @@ await sock.sendMessage(jid, {
|
|
|
270
456
|
|
|
271
457
|
Create Group
|
|
272
458
|
|
|
459
|
+
```
|
|
273
460
|
await sock.groupCreate(
|
|
274
461
|
"Test Group",
|
|
275
462
|
[
|
|
276
463
|
"628xxxx@s.whatsapp.net"
|
|
277
464
|
]
|
|
278
465
|
)
|
|
466
|
+
```
|
|
279
467
|
|
|
280
468
|
Get Metadata
|
|
281
469
|
|
|
470
|
+
```
|
|
282
471
|
const metadata =
|
|
283
472
|
await sock.groupMetadata(groupJid)
|
|
284
473
|
|
|
285
474
|
console.log(metadata)
|
|
475
|
+
```
|
|
286
476
|
|
|
287
477
|
---
|
|
288
478
|
|
|
@@ -290,13 +480,16 @@ console.log(metadata)
|
|
|
290
480
|
|
|
291
481
|
Create Channel
|
|
292
482
|
|
|
483
|
+
```
|
|
293
484
|
await sock.newsletterCreate(
|
|
294
485
|
"FVCKERS Channel",
|
|
295
486
|
"Official Channel"
|
|
296
487
|
)
|
|
488
|
+
```
|
|
297
489
|
|
|
298
490
|
Get Metadata
|
|
299
491
|
|
|
492
|
+
```
|
|
300
493
|
const meta =
|
|
301
494
|
await sock.newsletterMetadata(
|
|
302
495
|
"invite",
|
|
@@ -304,22 +497,26 @@ const meta =
|
|
|
304
497
|
)
|
|
305
498
|
|
|
306
499
|
console.log(meta)
|
|
500
|
+
```
|
|
307
501
|
|
|
308
502
|
---
|
|
309
503
|
|
|
310
504
|
### 📸 Upload Status
|
|
311
505
|
|
|
506
|
+
```
|
|
312
507
|
await sock.sendMessage(
|
|
313
508
|
"status@broadcast",
|
|
314
509
|
{
|
|
315
510
|
text: "Hello Status"
|
|
316
511
|
}
|
|
317
512
|
)
|
|
513
|
+
```
|
|
318
514
|
|
|
319
515
|
---
|
|
320
516
|
|
|
321
517
|
### 📨 Message Event
|
|
322
518
|
|
|
519
|
+
```
|
|
323
520
|
sock.ev.on(
|
|
324
521
|
"messages.upsert",
|
|
325
522
|
async ({ messages }) => {
|
|
@@ -331,6 +528,7 @@ sock.ev.on(
|
|
|
331
528
|
console.log(m)
|
|
332
529
|
}
|
|
333
530
|
)
|
|
531
|
+
```
|
|
334
532
|
|
|
335
533
|
---
|
|
336
534
|
|