sauruslord-baileys 2.0.5 → 2.0.6
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/lib/index.js +25 -19
- package/package.json +3 -2
- package/README.md +0 -645
package/lib/index.js
CHANGED
|
@@ -2,25 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
const chalk = require("chalk");
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
const center = (text) => {
|
|
6
|
+
const width = process.stdout.columns
|
|
7
|
+
const pad = Math.floor((width - text.length) / 2)
|
|
8
|
+
return " ".repeat(pad) + text
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
console.log(chalk.hex("#ffcc00")(`
|
|
12
|
+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠿⠿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
|
|
13
|
+
⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⢿⣿⣿⣿⣿⣿⣿⣿
|
|
14
|
+
⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠻⣿⣿⣿⣿⣿
|
|
15
|
+
⣿⣿⣿⡿⣋⣤⣤⣤⣄⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⡤⣤⣄⡀⠀⠀⠈⢿⣿⣿⣿
|
|
16
|
+
⣿⣿⡿⣽⠏⠀⢠⣿⣿⣷⡄⠀⠀⠀⠀⢠⡾⠋⠀⠀⣾⣿⣿⣦⠀⠀⠈⢻⣿⣿
|
|
17
|
+
⣿⣿⠁⡟⠀⠀⠀⠙⠛⠋⣷⠀⠀⠀⠀⢸⡇⠀⠀⠀⠈⠛⠛⢹⡆⠀⠀⠈⣿⣿
|
|
18
|
+
⣿⡟⠀⣿⣤⣤⣤⣤⣤⣴⡟⠀⠀⠀⠀⢸⣧⣤⣤⣤⣤⣤⣤⣼⠇⠀⠀⠀⢸⣿
|
|
19
|
+
⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿
|
|
20
|
+
⣿⣧⠀⠸⢶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣶⣦⠀⠀⠀⠀⢸⣿
|
|
21
|
+
⣿⣿⡄⠀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⢀⣿⣿
|
|
22
|
+
⣿⣿⣷⡄⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⣼⣿⣿
|
|
23
|
+
⣿⣿⣿⣷⣄⠀⠙⢿⣿⣿⣿⣿⣿⢟⠍⠀⠀⠀⠉⠙⢿⣿⡿⠁⠀⢀⣾⣿⣿⣿
|
|
24
|
+
⣿⣿⣿⣿⣿⣧⣄⠀⠻⢿⣿⣿⠓⠁⠀⠀⠀⢀⣀⣴⠾⠋⠀⢀⣴⣿⣿⣿⣿⣿
|
|
25
|
+
⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡈⠙⠛⠲⠶⠖⠛⠛⠉⢀⣠⣤⣾⣿⣿⣿⣿⣿⣿⣿
|
|
26
|
+
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣶⣶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿`));
|
|
27
|
+
console.log(chalk.hex("#cc3333")(center("━━━━━━━ LORDSAURUS ━━━━━━━")))
|
|
28
|
+
console.log(chalk.hex("#00b894")("Baileys modified by: @lordsaurus\n"));
|
|
29
|
+
console.log(chalk.hex("#00b894")("Terimakasih Sudah Menggunakan Baileys Saya"));
|
|
24
30
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
25
31
|
if (k2 === undefined) k2 = k;
|
|
26
32
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sauruslord-baileys",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "WhatsApp Baileys Modification",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"whatsapp-web",
|
|
9
9
|
"whatsapp-chat",
|
|
10
10
|
"whatsapp-group",
|
|
11
|
-
"botwa"
|
|
11
|
+
"botwa",
|
|
12
|
+
"wa"
|
|
12
13
|
],
|
|
13
14
|
"license": "MIT",
|
|
14
15
|
"author": "Lordsaurus",
|
package/README.md
DELETED
|
@@ -1,645 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<div align="center">
|
|
3
|
-
<h1>LORDSAURUS BAILEYS😋</h1>
|
|
4
|
-
<img src="https://cdn.raicong.my.id/files/pyaqrf.jpg" alt="Thumbnail" width='100%' />
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
<br>
|
|
8
|
-
|
|
9
|
-
The latest updated Baileys WhatsApp supports following channels, and doesn't exit easily when using WhatsApp or Telegram bots. This Baileys is equipped with the latest buttons and has updated the jid to lid, suitable for those of you who have a project. Please use this Baileys.
|
|
10
|
-
|
|
11
|
-
WhatsApp Baileys updates the jid to lid, payment/interactiveMessage/viewOnceMessage buttons and others, suitable for those of you who have a script project that you want
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
### Features improved by the owner
|
|
16
|
-
|
|
17
|
-
- Already supports custom pairing code
|
|
18
|
-
- Fixing damage to Pairing
|
|
19
|
-
- Supports Paymess, Interactive, and button
|
|
20
|
-
- Support button in WhatsApp business
|
|
21
|
-
- Faster performance
|
|
22
|
-
|
|
23
|
-
## Add Function ( Simple code )
|
|
24
|
-
|
|
25
|
-
### Label Group
|
|
26
|
-
Tag/Label Member Grop
|
|
27
|
-
|
|
28
|
-
```javascript
|
|
29
|
-
await saurus.setLabelGroup(jid, string)
|
|
30
|
-
```
|
|
31
|
-
---
|
|
32
|
-
### Delay
|
|
33
|
-
Sleep code ( hehe )
|
|
34
|
-
|
|
35
|
-
```javascript
|
|
36
|
-
await saurus.delay(seconds) // ex. 3 ( 3 seconds )
|
|
37
|
-
// example
|
|
38
|
-
await saurus.delay(3)
|
|
39
|
-
```
|
|
40
|
-
---
|
|
41
|
-
### React Message
|
|
42
|
-
Send Reaction into the Message
|
|
43
|
-
|
|
44
|
-
```javascript
|
|
45
|
-
await saurus.react(m, emoji)
|
|
46
|
-
// Example
|
|
47
|
-
await saurus.react(m, "😚")
|
|
48
|
-
```
|
|
49
|
-
---
|
|
50
|
-
### Delete React Message
|
|
51
|
-
Delete Reaction into the Message
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
// Example
|
|
55
|
-
await saurus.unreact(m)
|
|
56
|
-
```
|
|
57
|
-
---
|
|
58
|
-
### Check ID Channel / Newsletter / Saluran
|
|
59
|
-
Get ID Channel From Url
|
|
60
|
-
|
|
61
|
-
```javascript
|
|
62
|
-
await saurus.cekIDSaluran(url)
|
|
63
|
-
```
|
|
64
|
-
Result JSON
|
|
65
|
-
```json
|
|
66
|
-
{
|
|
67
|
-
"name": "Name Channel",
|
|
68
|
-
"id": "Channel ID",
|
|
69
|
-
"state": "Status Channel",
|
|
70
|
-
"subscribers": "Followers",
|
|
71
|
-
"verification": "UNVERIFIED",
|
|
72
|
-
"creation_time": 1728547155,
|
|
73
|
-
"description": "Description Channel"
|
|
74
|
-
// ...etc
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
---
|
|
78
|
-
### Multiple Follow Newsletter
|
|
79
|
-
Just one line, not use array, just string with space " "
|
|
80
|
-
|
|
81
|
-
```javascript
|
|
82
|
-
await saurus.newsletterMultipleFollow(jids)
|
|
83
|
-
// Example
|
|
84
|
-
await saurus.newsletterMultipleFollow("120xxxxxxx@newsletter 120xxxxxxxxx@newsletter 120xxxxxxx@newsletter")
|
|
85
|
-
```
|
|
86
|
-
---
|
|
87
|
-
### Check banned number
|
|
88
|
-
You can see the status of blocked numbers here
|
|
89
|
-
|
|
90
|
-
```javascript
|
|
91
|
-
saurus.checkBanned(jid)
|
|
92
|
-
```
|
|
93
|
-
---
|
|
94
|
-
### Edit Message
|
|
95
|
-
Edit your previously sent message
|
|
96
|
-
```js
|
|
97
|
-
await saurus.edit(m, newText)
|
|
98
|
-
// Example
|
|
99
|
-
await saurus.edit(m, "this is edited message")
|
|
100
|
-
```
|
|
101
|
-
Notes
|
|
102
|
-
- Only works for messages sent by yourself
|
|
103
|
-
- Supports private chat, group, and newsletter
|
|
104
|
-
---
|
|
105
|
-
### Delete / Revoke Message
|
|
106
|
-
Delete or revoke a message
|
|
107
|
-
```js
|
|
108
|
-
await saurus.del(m)
|
|
109
|
-
// Example
|
|
110
|
-
await saurus.del(m)
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Notes
|
|
114
|
-
- Private chat: revoke message
|
|
115
|
-
- Group chat:
|
|
116
|
-
- - Your message -> revoke for everyone
|
|
117
|
-
- - Other message -> delete for me
|
|
118
|
-
---
|
|
119
|
-
### Detect Message
|
|
120
|
-
Detect message type from incoming message object.
|
|
121
|
-
```js
|
|
122
|
-
saurus.detect(m)
|
|
123
|
-
// Example
|
|
124
|
-
const type = saurus.detect(m)
|
|
125
|
-
if (type === 'image') {
|
|
126
|
-
// handle image message
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
**Returned Type**
|
|
130
|
-
- text
|
|
131
|
-
- image
|
|
132
|
-
- video
|
|
133
|
-
- gif
|
|
134
|
-
- audio
|
|
135
|
-
- ptt
|
|
136
|
-
- sticker
|
|
137
|
-
- document
|
|
138
|
-
- reaction
|
|
139
|
-
- viewonce
|
|
140
|
-
- edited
|
|
141
|
-
- revoke
|
|
142
|
-
- interactive
|
|
143
|
-
- poll
|
|
144
|
-
- location
|
|
145
|
-
- contact
|
|
146
|
-
- Unknown
|
|
147
|
-
|
|
148
|
-
**Notes**
|
|
149
|
-
- Automatically normalizes message content
|
|
150
|
-
- Safe for plugins and middleware
|
|
151
|
-
- Avoid deep manual message checks
|
|
152
|
-
- Stable across Baileys updates
|
|
153
|
-
---
|
|
154
|
-
# SendMessage Documentation
|
|
155
|
-
|
|
156
|
-
### Send Status Mention
|
|
157
|
-
Status Mention Group & Private Message
|
|
158
|
-
Send Status Mention Group/Private Chat
|
|
159
|
-
|
|
160
|
-
```javascript
|
|
161
|
-
await saurus.sendStatusMention(content, jid);
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Status Group Message V2
|
|
165
|
-
Send Group Status With Version 2
|
|
166
|
-
|
|
167
|
-
```javascript
|
|
168
|
-
await saurus.sendMessage(jid, {
|
|
169
|
-
groupStatusMessage: {
|
|
170
|
-
text: "Hello World"
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### Album Message (Multiple Images)
|
|
176
|
-
Send multiple images in a single album message:
|
|
177
|
-
|
|
178
|
-
```javascript
|
|
179
|
-
await saurus.sendMessage(jid, {
|
|
180
|
-
albumMessage: [
|
|
181
|
-
{ image: buffer, caption: "Foto pertama" },
|
|
182
|
-
{ image: { url: "URL IMAGE" }, caption: "Foto kedua" }
|
|
183
|
-
]
|
|
184
|
-
}, { quoted: m });
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Event Message
|
|
188
|
-
Create and send WhatsApp event invitations:
|
|
189
|
-
|
|
190
|
-
```javascript
|
|
191
|
-
await saurus.sendMessage(jid, {
|
|
192
|
-
eventMessage: {
|
|
193
|
-
isCanceled: false,
|
|
194
|
-
name: "Hello World",
|
|
195
|
-
description: "saurusganteng",
|
|
196
|
-
location: {
|
|
197
|
-
degreesLatitude: 0,
|
|
198
|
-
degreesLongitude: 0,
|
|
199
|
-
name: "rowrrrr"
|
|
200
|
-
},
|
|
201
|
-
joinLink: "https://call.whatsapp.com/video/saweitt",
|
|
202
|
-
startTime: "1763019000",
|
|
203
|
-
endTime: "1763026200",
|
|
204
|
-
extraGuestsAllowed: false
|
|
205
|
-
}
|
|
206
|
-
}, { quoted: m });
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
### Poll Result Message
|
|
210
|
-
Display poll results with vote counts:
|
|
211
|
-
|
|
212
|
-
```javascript
|
|
213
|
-
await saurus.sendMessage(jid, {
|
|
214
|
-
pollResultMessage: {
|
|
215
|
-
name: "Hello World",
|
|
216
|
-
pollVotes: [
|
|
217
|
-
{
|
|
218
|
-
optionName: "TEST 1",
|
|
219
|
-
optionVoteCount: "112233"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
optionName: "TEST 2",
|
|
223
|
-
optionVoteCount: "1"
|
|
224
|
-
}
|
|
225
|
-
]
|
|
226
|
-
}
|
|
227
|
-
}, { quoted: m });
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### Simple Interactive Message
|
|
231
|
-
Send basic interactive messages with copy button functionality:
|
|
232
|
-
|
|
233
|
-
```javascript
|
|
234
|
-
await saurus.sendMessage(jid, {
|
|
235
|
-
interactiveMessage: {
|
|
236
|
-
header: "Hello World",
|
|
237
|
-
title: "Hello World",
|
|
238
|
-
footer: "saurus MD",
|
|
239
|
-
buttons: [
|
|
240
|
-
{
|
|
241
|
-
name: "cta_copy",
|
|
242
|
-
buttonParamsJson: JSON.stringify({
|
|
243
|
-
display_text: "copy code",
|
|
244
|
-
id: "123456789",
|
|
245
|
-
copy_code: "ABC123XYZ"
|
|
246
|
-
})
|
|
247
|
-
}
|
|
248
|
-
]
|
|
249
|
-
}
|
|
250
|
-
}, { quoted: m });
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
### Interactive Message with Native Flow
|
|
254
|
-
Send interactive messages with buttons, copy actions, and native flow features:
|
|
255
|
-
|
|
256
|
-
```javascript
|
|
257
|
-
await saurus.sendMessage(jid, {
|
|
258
|
-
interactiveMessage: {
|
|
259
|
-
header: "Hello World",
|
|
260
|
-
title: "Hello World",
|
|
261
|
-
footer: "saurus",
|
|
262
|
-
image: { url: "https://example.com/image.jpg" },
|
|
263
|
-
nativeFlowMessage: {
|
|
264
|
-
messageParamsJson: JSON.stringify({
|
|
265
|
-
limited_time_offer: {
|
|
266
|
-
text: "idk hummmm?",
|
|
267
|
-
url: "https://saurus.site",
|
|
268
|
-
copy_code: "saurusganteng",
|
|
269
|
-
expiration_time: Date.now() * 999
|
|
270
|
-
},
|
|
271
|
-
bottom_sheet: {
|
|
272
|
-
in_thread_buttons_limit: 2,
|
|
273
|
-
divider_indices: [1, 2, 3, 4, 5, 999],
|
|
274
|
-
list_title: "saurusganteng",
|
|
275
|
-
button_title: "saurusganteng"
|
|
276
|
-
},
|
|
277
|
-
tap_target_configuration: {
|
|
278
|
-
title: " X ",
|
|
279
|
-
description: "bomboclard",
|
|
280
|
-
canonical_url: "https://saurus.site",
|
|
281
|
-
domain: "shop.example.com",
|
|
282
|
-
button_index: 0
|
|
283
|
-
}
|
|
284
|
-
}),
|
|
285
|
-
buttons: [
|
|
286
|
-
{
|
|
287
|
-
name: "single_select",
|
|
288
|
-
buttonParamsJson: JSON.stringify({
|
|
289
|
-
has_multiple_buttons: true
|
|
290
|
-
})
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
name: "call_permission_request",
|
|
294
|
-
buttonParamsJson: JSON.stringify({
|
|
295
|
-
has_multiple_buttons: true
|
|
296
|
-
})
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
name: "single_select",
|
|
300
|
-
buttonParamsJson: JSON.stringify({
|
|
301
|
-
title: "Hello World",
|
|
302
|
-
sections: [
|
|
303
|
-
{
|
|
304
|
-
title: "title",
|
|
305
|
-
highlight_label: "label",
|
|
306
|
-
rows: [
|
|
307
|
-
{
|
|
308
|
-
title: "@saweitt",
|
|
309
|
-
description: "love you",
|
|
310
|
-
id: "row_2"
|
|
311
|
-
}
|
|
312
|
-
]
|
|
313
|
-
}
|
|
314
|
-
],
|
|
315
|
-
has_multiple_buttons: true
|
|
316
|
-
})
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
name: "cta_copy",
|
|
320
|
-
buttonParamsJson: JSON.stringify({
|
|
321
|
-
display_text: "copy code",
|
|
322
|
-
id: "123456789",
|
|
323
|
-
copy_code: "ABC123XYZ"
|
|
324
|
-
})
|
|
325
|
-
}
|
|
326
|
-
]
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
}, { quoted: m });
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
### Interactive Message with Thumbnail
|
|
333
|
-
Send interactive messages with thumbnail image and copy button:
|
|
334
|
-
|
|
335
|
-
```javascript
|
|
336
|
-
await saurus.sendMessage(jid, {
|
|
337
|
-
interactiveMessage: {
|
|
338
|
-
header: "Hello World",
|
|
339
|
-
title: "Hello World",
|
|
340
|
-
footer: "saurus",
|
|
341
|
-
image: { url: "https://example.com/image.jpg" },
|
|
342
|
-
buttons: [
|
|
343
|
-
{
|
|
344
|
-
name: "cta_copy",
|
|
345
|
-
buttonParamsJson: JSON.stringify({
|
|
346
|
-
display_text: "copy code",
|
|
347
|
-
id: "123456789",
|
|
348
|
-
copy_code: "ABC123XYZ"
|
|
349
|
-
})
|
|
350
|
-
}
|
|
351
|
-
]
|
|
352
|
-
}
|
|
353
|
-
}, { quoted: m });
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
### Product Message
|
|
357
|
-
Send product catalog messages with buttons and merchant information:
|
|
358
|
-
|
|
359
|
-
```javascript
|
|
360
|
-
await saurus.sendMessage(jid, {
|
|
361
|
-
productMessage: {
|
|
362
|
-
title: "Produk Contoh",
|
|
363
|
-
description: "Ini adalah deskripsi produk",
|
|
364
|
-
thumbnail: { url: "https://example.com/image.jpg" },
|
|
365
|
-
productId: "PROD001",
|
|
366
|
-
retailerId: "RETAIL001",
|
|
367
|
-
url: "https://example.com/product",
|
|
368
|
-
body: "Detail produk",
|
|
369
|
-
footer: "Harga spesial",
|
|
370
|
-
priceAmount1000: 50000,
|
|
371
|
-
currencyCode: "USD",
|
|
372
|
-
buttons: [
|
|
373
|
-
{
|
|
374
|
-
name: "cta_url",
|
|
375
|
-
buttonParamsJson: JSON.stringify({
|
|
376
|
-
display_text: "Beli Sekarang",
|
|
377
|
-
url: "https://example.com/buy"
|
|
378
|
-
})
|
|
379
|
-
}
|
|
380
|
-
]
|
|
381
|
-
}
|
|
382
|
-
}, { quoted: m });
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
### Interactive Message with Document Buffer
|
|
386
|
-
Send interactive messages with document from buffer (file system) - **Note: Documents only support buffer**:
|
|
387
|
-
|
|
388
|
-
```javascript
|
|
389
|
-
await saurus.sendMessage(jid, {
|
|
390
|
-
interactiveMessage: {
|
|
391
|
-
header: "Hello World",
|
|
392
|
-
title: "Hello World",
|
|
393
|
-
footer: "saurus",
|
|
394
|
-
document: fs.readFileSync("./package.json"),
|
|
395
|
-
mimetype: "application/pdf",
|
|
396
|
-
fileName: "saweitt.pdf",
|
|
397
|
-
jpegThumbnail: fs.readFileSync("./document.jpeg"),
|
|
398
|
-
contextInfo: {
|
|
399
|
-
mentionedJid: [jid],
|
|
400
|
-
forwardingScore: 777,
|
|
401
|
-
isForwarded: false
|
|
402
|
-
},
|
|
403
|
-
externalAdReply: {
|
|
404
|
-
title: "saurus MD",
|
|
405
|
-
body: "saurus",
|
|
406
|
-
mediaType: 3,
|
|
407
|
-
thumbnailUrl: "https://example.com/image.jpg",
|
|
408
|
-
mediaUrl: " X ",
|
|
409
|
-
sourceUrl: "https://saurus.site",
|
|
410
|
-
showAdAttribution: true,
|
|
411
|
-
renderLargerThumbnail: false
|
|
412
|
-
},
|
|
413
|
-
buttons: [
|
|
414
|
-
{
|
|
415
|
-
name: "cta_url",
|
|
416
|
-
buttonParamsJson: JSON.stringify({
|
|
417
|
-
display_text: "Telegram",
|
|
418
|
-
url: "https://saurus.site",
|
|
419
|
-
merchant_url: "https://saurus.site"
|
|
420
|
-
})
|
|
421
|
-
}
|
|
422
|
-
]
|
|
423
|
-
}
|
|
424
|
-
}, { quoted: m });
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
### Interactive Message with Document Buffer (Simple)
|
|
428
|
-
Send interactive messages with document from buffer (file system) without contextInfo and externalAdReply - **Note: Documents only support buffer**:
|
|
429
|
-
|
|
430
|
-
```javascript
|
|
431
|
-
await saurus.sendMessage(jid, {
|
|
432
|
-
interactiveMessage: {
|
|
433
|
-
header: "Hello World",
|
|
434
|
-
title: "Hello World",
|
|
435
|
-
footer: "saurus MD",
|
|
436
|
-
document: fs.readFileSync("./package.json"),
|
|
437
|
-
mimetype: "application/pdf",
|
|
438
|
-
fileName: "saweitt.pdf",
|
|
439
|
-
jpegThumbnail: fs.readFileSync("./document.jpeg"),
|
|
440
|
-
buttons: [
|
|
441
|
-
{
|
|
442
|
-
name: "cta_url",
|
|
443
|
-
buttonParamsJson: JSON.stringify({
|
|
444
|
-
display_text: "Telegram",
|
|
445
|
-
url: "https://saurus.site",
|
|
446
|
-
merchant_url: "https://saurus.site"
|
|
447
|
-
})
|
|
448
|
-
}
|
|
449
|
-
]
|
|
450
|
-
}
|
|
451
|
-
}, { quoted: m });
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
### Request Payment Message
|
|
455
|
-
Send payment request messages with custom background and sticker:
|
|
456
|
-
|
|
457
|
-
```javascript
|
|
458
|
-
let quotedType = m.quoted?.mtype || '';
|
|
459
|
-
let quotedContent = JSON.stringify({ [quotedType]: m.quoted }, null, 2);
|
|
460
|
-
|
|
461
|
-
await saurus.sendMessage(jid, {
|
|
462
|
-
requestPaymentMessage: {
|
|
463
|
-
currency: "IDR",
|
|
464
|
-
amount: 10000000,
|
|
465
|
-
from: m.sender,
|
|
466
|
-
sticker: JSON.parse(quotedContent),
|
|
467
|
-
background: {
|
|
468
|
-
id: "100",
|
|
469
|
-
fileLength: "0",
|
|
470
|
-
width: 1000,
|
|
471
|
-
height: 1000,
|
|
472
|
-
mimetype: "image/webp",
|
|
473
|
-
placeholderArgb: 0xFF00FFFF,
|
|
474
|
-
textArgb: 0xFFFFFFFF,
|
|
475
|
-
subtextArgb: 0xFFAA00FF
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}, { quoted: m });
|
|
479
|
-
```
|
|
480
|
-
|
|
481
|
-
### Carousel Message
|
|
482
|
-
Send a carousel message with multiple cards:
|
|
483
|
-
|
|
484
|
-
```javascript
|
|
485
|
-
await saurus.sendMessage(
|
|
486
|
-
jid,
|
|
487
|
-
{
|
|
488
|
-
text: 'Body Message',
|
|
489
|
-
title: 'Title Message',
|
|
490
|
-
subtile: 'Subtitle Message',
|
|
491
|
-
footer: 'Footer Message',
|
|
492
|
-
cards: [
|
|
493
|
-
{
|
|
494
|
-
image: { url: 'https://example.com/jdbenkksjs.jpg' }, // or buffer
|
|
495
|
-
title: 'Title Cards',
|
|
496
|
-
body: 'Body Cards',
|
|
497
|
-
footer: 'Footer Cards',
|
|
498
|
-
buttons: [
|
|
499
|
-
{
|
|
500
|
-
name: 'quick_reply',
|
|
501
|
-
buttonParamsJson: JSON.stringify({
|
|
502
|
-
display_text: 'Display Button',
|
|
503
|
-
id: 'ID'
|
|
504
|
-
})
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
name: 'cta_url',
|
|
508
|
-
buttonParamsJson: JSON.stringify({
|
|
509
|
-
display_text: 'Display Button',
|
|
510
|
-
url: 'https://www.example.com'
|
|
511
|
-
})
|
|
512
|
-
}
|
|
513
|
-
]
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
video: { url: 'https://example.com/jdbenkksjs.mp4' }, // or buffer
|
|
517
|
-
title: 'Title Cards',
|
|
518
|
-
body: 'Body Cards',
|
|
519
|
-
footer: 'Footer Cards',
|
|
520
|
-
buttons: [
|
|
521
|
-
{
|
|
522
|
-
name: 'quick_reply',
|
|
523
|
-
buttonParamsJson: JSON.stringify({
|
|
524
|
-
display_text: 'Display Button',
|
|
525
|
-
id: 'ID'
|
|
526
|
-
})
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
name: 'cta_url',
|
|
530
|
-
buttonParamsJson: JSON.stringify({
|
|
531
|
-
display_text: 'Display Button',
|
|
532
|
-
url: 'https://www.example.com'
|
|
533
|
-
})
|
|
534
|
-
}
|
|
535
|
-
]
|
|
536
|
-
}
|
|
537
|
-
]
|
|
538
|
-
}
|
|
539
|
-
)
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
### Sticker Pack Message
|
|
543
|
-
Send a sticker pack with multiple stickers in one message:
|
|
544
|
-
|
|
545
|
-
```javascript
|
|
546
|
-
await saurus.sendMessage(jid, {
|
|
547
|
-
stickerPack: {
|
|
548
|
-
name: "My Sticker Pack",
|
|
549
|
-
publisher: "SHIKIMORI MD",
|
|
550
|
-
description: "Custom sticker pack",
|
|
551
|
-
cover: { url: "https://example.com/cover.png" },
|
|
552
|
-
stickers: [
|
|
553
|
-
{ sticker: fs.readFileSync("./sticker1.webp"), emojis: ["😎"] },
|
|
554
|
-
{ sticker: fs.readFileSync("./sticker2.webp"), isAnimated: true },
|
|
555
|
-
{ sticker: { url: "https://example.com/sticker3.webp" } }
|
|
556
|
-
]
|
|
557
|
-
}
|
|
558
|
-
}, { quoted: m });
|
|
559
|
-
```
|
|
560
|
-
|
|
561
|
-
**Sticker Options**
|
|
562
|
-
- `sticker` — Buffer or URL of the sticker (WebP format)
|
|
563
|
-
- `emojis` — Array of emoji associated with the sticker
|
|
564
|
-
- `isAnimated` — Set to `true` for animated stickers
|
|
565
|
-
- `isLottie` — Set to `true` for Lottie stickers
|
|
566
|
-
- `accessibilityLabel` — Accessibility label for the sticker
|
|
567
|
-
|
|
568
|
-
---
|
|
569
|
-
|
|
570
|
-
## Media Utilities
|
|
571
|
-
|
|
572
|
-
Lightweight media processing functions built directly into the socket. Uses `sharp` (native C) for images and `ffmpeg` pipes for video/audio — zero temp files, maximum speed.
|
|
573
|
-
|
|
574
|
-
### Resize
|
|
575
|
-
Fast image resize with aspect ratio preserved
|
|
576
|
-
|
|
577
|
-
```javascript
|
|
578
|
-
const resized = await saurus.resize(buffer, 200, 200)
|
|
579
|
-
```
|
|
580
|
-
---
|
|
581
|
-
### Convert
|
|
582
|
-
Convert media format — supports `jpeg`, `jpg`, `png`, `webp`, `mp3`, `mp4`
|
|
583
|
-
|
|
584
|
-
```javascript
|
|
585
|
-
const mp4 = await saurus.convert(buffer, { to: "mp4" })
|
|
586
|
-
const webp = await saurus.convert(buffer, { to: "webp" })
|
|
587
|
-
const mp3 = await saurus.convert(buffer, { to: "mp3" })
|
|
588
|
-
```
|
|
589
|
-
---
|
|
590
|
-
### To Sticker
|
|
591
|
-
Convert any image to WhatsApp sticker format (512x512 WebP with transparency)
|
|
592
|
-
|
|
593
|
-
```javascript
|
|
594
|
-
const sticker = await saurus.toSticker(buffer)
|
|
595
|
-
const sticker = await saurus.toSticker(buffer, { quality: 90 })
|
|
596
|
-
```
|
|
597
|
-
---
|
|
598
|
-
### Compress
|
|
599
|
-
Compress media with quality control — auto-detects image or video
|
|
600
|
-
|
|
601
|
-
```javascript
|
|
602
|
-
const compressed = await saurus.compress(buffer, { quality: 50 })
|
|
603
|
-
```
|
|
604
|
-
---
|
|
605
|
-
### Metadata
|
|
606
|
-
Extract media metadata — auto-detects image (sharp) or video/audio (ffprobe)
|
|
607
|
-
|
|
608
|
-
```javascript
|
|
609
|
-
const info = await saurus.metadata(buffer)
|
|
610
|
-
```
|
|
611
|
-
|
|
612
|
-
Result JSON
|
|
613
|
-
```json
|
|
614
|
-
{
|
|
615
|
-
"size": 102400,
|
|
616
|
-
"mimetype": "image/jpeg",
|
|
617
|
-
"width": 1920,
|
|
618
|
-
"height": 1080,
|
|
619
|
-
"channels": 3,
|
|
620
|
-
"hasAlpha": false
|
|
621
|
-
}
|
|
622
|
-
```
|
|
623
|
-
|
|
624
|
-
For video/audio:
|
|
625
|
-
```json
|
|
626
|
-
{
|
|
627
|
-
"size": 5242880,
|
|
628
|
-
"mimetype": "video/mp4",
|
|
629
|
-
"width": 1280,
|
|
630
|
-
"height": 720,
|
|
631
|
-
"duration": 30.5
|
|
632
|
-
}
|
|
633
|
-
```
|
|
634
|
-
|
|
635
|
-
---
|
|
636
|
-
|
|
637
|
-
## Why Choose WhatsApp Baileys?
|
|
638
|
-
|
|
639
|
-
Because this library offers high stability, full features, and an actively improved pairing process. It is ideal for developers aiming to create professional and secure WhatsApp automation solutions. Support for the latest WhatsApp features ensures compatibility with platform updates.
|
|
640
|
-
|
|
641
|
-
---
|
|
642
|
-
|
|
643
|
-
For complete documentation, installation guides, and implementation examples, please visit the official repository and community forums. We continually update and improve this library to meet the needs of developers and users of modern WhatsApp automation solutions.
|
|
644
|
-
|
|
645
|
-
**Thank you for choosing WhatsApp Baileys as your WhatsApp automation solution!**
|