@fazzcode/baileys 0.1.1 β†’ 0.1.5

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 (3) hide show
  1. package/README.MD +121 -0
  2. package/package.json +1 -1
  3. package/README.md +0 -359
package/README.MD ADDED
@@ -0,0 +1,121 @@
1
+ # πŸš€ WhatsApp Baileys
2
+
3
+ <p align="center">
4
+ <img src="https://raw.githubusercontent.com/FazzCode-Backend/database/refs/heads/main/img/logo/Gemini_Generated_Image_e1100ge1100ge110.png" alt="Thumbnail" width="600px" />
5
+ </p>
6
+
7
+ <p align="center">
8
+ <strong>Build powerful WhatsApp automation with ease.</strong><br>
9
+ Developed with ❀️ by <b>FazzCode</b>
10
+ </p>
11
+
12
+ ---
13
+
14
+ ## πŸ“– Overview
15
+
16
+ **WhatsApp Baileys** is an open-source library designed to help developers build automation solutions and integrations with WhatsApp efficiently and directly. Using websocket technology without the need for a browser, this library supports a wide range of features such as message management, chat handling, group administration, as well as interactive messages and action buttons for a more dynamic user experience.
17
+
18
+ Actively developed and maintained, baileys continuously receives updates to enhance stability and performance. One of the main focuses is to improve the pairing and authentication processes to be more stable and secure.
19
+
20
+ ---
21
+
22
+ ## ✨ Main Features & Advantages
23
+
24
+ * **⚑ Lightweight & Fast:** Built on websocket technology without browser overhead.
25
+ * **πŸ”— Advanced Pairing:** Supports automatic and custom pairing processes with fixed stability.
26
+ * **🎨 Rich Media:** Supports interactive messages, action buttons, and dynamic menus.
27
+ * **πŸ“‚ Session Management:** Efficient automatic session management for reliable long-term operation.
28
+ * **πŸ“± Multi-Device:** Fully compatible with the latest WhatsApp Multi-Device features.
29
+ * **πŸ›  Developer Friendly:** Comprehensive documentation and example codes for quick integration.
30
+
31
+ ---
32
+
33
+ ## πŸš€ Getting Started
34
+
35
+ Begin by installing the library via your preferred package manager:
36
+
37
+ ```bash
38
+ npm install @fazzcode/baileys
39
+ # or
40
+ yarn add @fazzcode/baileys
41
+ Then, follow the configuration guide or utilize the ready-made example codes below to start building your stable, tailored WhatsApp solution.πŸ›  SendMessage DocumentationπŸ“Έ Album Message (Multiple Images)Send multiple images in a single grouped album:JavaScriptawait sock.sendMessage(jid, {
42
+ albumMessage: [
43
+ { image: cihuy, caption: "Foto pertama" },
44
+ { image: { url: "URL IMAGE" }, caption: "Foto kedua" }
45
+ ]
46
+ }, { quoted: m });
47
+ πŸ“… Event MessageCreate and send official WhatsApp event invitations:JavaScriptawait sock.sendMessage(jid, {
48
+ eventMessage: {
49
+ isCanceled: false,
50
+ name: "Grand Launching",
51
+ description: "Join our community event!",
52
+ location: { degreesLatitude: 0, degreesLongitude: 0, name: "Jakarta" },
53
+ joinLink: "[https://call.whatsapp.com/video/example](https://call.whatsapp.com/video/example)",
54
+ startTime: "1763019000",
55
+ endTime: "1763026200",
56
+ extraGuestsAllowed: false
57
+ }
58
+ }, { quoted: m });
59
+ πŸ“Š Poll Result MessageDisplay live poll results with real-time vote counts:JavaScriptawait sock.sendMessage(jid, {
60
+ pollResultMessage: {
61
+ name: "Favorite Language",
62
+ pollVotes: [
63
+ { optionName: "JavaScript", optionVoteCount: "112233" },
64
+ { optionName: "TypeScript", optionVoteCount: "1500" }
65
+ ]
66
+ }
67
+ }, { quoted: m });
68
+ πŸ”˜ Interactive Message (CTA Copy)Basic interactive messages with a "Click to Copy" functionality:JavaScriptawait sock.sendMessage(jid, {
69
+ interactiveMessage: {
70
+ title: "Voucher Code",
71
+ footer: "Powered by FazzCode",
72
+ buttons: [
73
+ {
74
+ name: "cta_copy",
75
+ buttonParamsJson: JSON.stringify({
76
+ display_text: "Copy Promo Code",
77
+ id: "promo-123",
78
+ copy_code: "FAZZCODE2026"
79
+ })
80
+ }
81
+ ]
82
+ }
83
+ }, { quoted: m });
84
+ πŸ”— Product & CatalogSend professional product previews with direct CTA buttons:JavaScriptawait sock.sendMessage(jid, {
85
+ productMessage: {
86
+ title: "Exclusive Bot Script",
87
+ description: "Full feature automation script",
88
+ thumbnail: { url: "[https://example.com/thumb.jpg](https://example.com/thumb.jpg)" },
89
+ productId: "PROD001",
90
+ priceAmount1000: 50000,
91
+ currencyCode: "IDR",
92
+ buttons: [
93
+ {
94
+ name: "cta_url",
95
+ buttonParamsJson: JSON.stringify({
96
+ display_text: "Buy Now",
97
+ url: "[https://fazzcode.com/buy](https://fazzcode.com/buy)"
98
+ })
99
+ }
100
+ ]
101
+ }
102
+ }, { quoted: m });
103
+ πŸ“„ Document Message (Buffer)Note: Documents only support buffer input.JavaScriptawait sock.sendMessage(jid, {
104
+ interactiveMessage: {
105
+ title: "Project Documentation",
106
+ footer: "telegram: @stvnnvs",
107
+ document: fs.readFileSync("./manual.pdf"),
108
+ mimetype: "application/pdf",
109
+ fileName: "Manual_Book.pdf",
110
+ buttons: [
111
+ {
112
+ name: "cta_url",
113
+ buttonParamsJson: JSON.stringify({
114
+ display_text: "Support Channel",
115
+ url: "[https://t.me/stvnnvs](https://t.me/stvnnvs)"
116
+ })
117
+ }
118
+ ]
119
+ }
120
+ }, { quoted: m });
121
+ πŸ’‘ Why Choose This Library?FeatureBenefitHigh StabilityMinimized disconnection issues.Custom PairingMore secure and reliable authentication.Modern APISupports Interactive Buttons, Native Flow, and Polls.Active SupportContinually updated for latest WA versions.πŸ“ Technical NotesSupports custom pairing codes for headless environments.Efficient automatic session management for 24/7 uptime.Perfect for building Customer Service Bots, Notification Systems, and AI Integrations.<p align="center"><b>Thank you for choosing WhatsApp Baileys!</b>Maintenance and updates by <a href="https://www.google.com/search?q=https://github.com/fazzcode">@FazzCode</a></p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fazzcode/baileys",
3
- "version": "0.1.1",
3
+ "version": "0.1.5",
4
4
  "description": "WhatsApp API Modification By FazzCode - A WhatsApp Web API for NodeJS",
5
5
  "keywords": [
6
6
  "whatsapp",
package/README.md DELETED
@@ -1,359 +0,0 @@
1
- # WhatsApp Baileys
2
-
3
- <p align="center">
4
- <img src="https://raw.githubusercontent.com/kiuur/kiuur/refs/heads/main/20250823_171204.png" alt="Thumbnail" />
5
- </p>
6
-
7
- WhatsApp Baileys is an open-source library designed to help developers build automation solutions and integrations with WhatsApp efficiently and directly. Using websocket technology without the need for a browser, this library supports a wide range of features such as message management, chat handling, group administration, as well as interactive messages and action buttons for a more dynamic user experience.
8
-
9
- Actively developed and maintained, baileys continuously receives updates to enhance stability and performance. One of the main focuses is to improve the pairing and authentication processes to be more stable and secure. Pairing features can be customized with your own codes, making the process more reliable and less prone to interruptions.
10
-
11
- This library is highly suitable for building business bots, chat automation systems, customer service solutions, and various other communication automation applications that require high stability and comprehensive features. With a lightweight and modular design, baileys is easy to integrate into different systems and platforms.
12
-
13
- ---
14
-
15
- ### Main Features and Advantages
16
-
17
- - Supports automatic and custom pairing processes
18
- - Fixes previous pairing issues that often caused failures or disconnections
19
- - Supports interactive messages, action buttons, and dynamic menus
20
- - Efficient automatic session management for reliable operation
21
- - Compatible with the latest multi-device features from WhatsApp
22
- - Lightweight, stable, and easy to integrate into various systems
23
- - Suitable for developing bots, automation, and complete communication solutions
24
- - Comprehensive documentation and example codes to facilitate development
25
-
26
- ---
27
-
28
- ## Getting Started
29
-
30
- Begin by installing the library via your preferred package manager, then follow the provided configuration guide. You can also utilize the ready-made example codes to understand how the features work. Use session storage and interactive messaging features to build complete, stable solutions tailored to your business or project needs.
31
-
32
- ---
33
-
34
- ## SendMessage Documentation
35
-
36
- ### Album Message (Multiple Images)
37
- Send multiple images in a single album message:
38
-
39
- ```javascript
40
- await sock.sendMessage(jid, {
41
- albumMessage: [
42
- { image: cihuy, caption: "Foto pertama" },
43
- { image: { url: "URL IMAGE" }, caption: "Foto kedua" }
44
- ]
45
- }, { quoted: m });
46
- ```
47
-
48
- ### Event Message
49
- Create and send WhatsApp event invitations:
50
-
51
- ```javascript
52
- await sock.sendMessage(jid, {
53
- eventMessage: {
54
- isCanceled: false,
55
- name: "Hello World",
56
- description: "stvnnvs",
57
- location: {
58
- degreesLatitude: 0,
59
- degreesLongitude: 0,
60
- name: "rowrrrr"
61
- },
62
- joinLink: "https://call.whatsapp.com/video/stvnnvs",
63
- startTime: "1763019000",
64
- endTime: "1763026200",
65
- extraGuestsAllowed: false
66
- }
67
- }, { quoted: m });
68
- ```
69
-
70
- ### Poll Result Message
71
- Display poll results with vote counts:
72
-
73
- ```javascript
74
- await sock.sendMessage(jid, {
75
- pollResultMessage: {
76
- name: "Hello World",
77
- pollVotes: [
78
- {
79
- optionName: "TEST 1",
80
- optionVoteCount: "112233"
81
- },
82
- {
83
- optionName: "TEST 2",
84
- optionVoteCount: "1"
85
- }
86
- ]
87
- }
88
- }, { quoted: m });
89
- ```
90
-
91
- ### Simple Interactive Message
92
- Send basic interactive messages with copy button functionality:
93
-
94
- ```javascript
95
- await sock.sendMessage(jid, {
96
- interactiveMessage: {
97
- title: "Hello World",
98
- footer: "telegram: @stvnnvs ",
99
- buttons: [
100
- {
101
- name: "cta_copy",
102
- buttonParamsJson: JSON.stringify({
103
- display_text: "copy code",
104
- id: "123456789",
105
- copy_code: "ABC123XYZ"
106
- })
107
- }
108
- ]
109
- }
110
- }, { quoted: m });
111
- ```
112
-
113
- ### Interactive Message with Native Flow
114
- Send interactive messages with buttons, copy actions, and native flow features:
115
-
116
- ```javascript
117
- await sock.sendMessage(jid, {
118
- interactiveMessage: {
119
- title: "Hello World",
120
- footer: "telegram: @stvnnvs",
121
- image: { url: "https://example.com/image.jpg" },
122
- nativeFlowMessage: {
123
- messageParamsJson: JSON.stringify({
124
- limited_time_offer: {
125
- text: "idk hummmm?",
126
- url: "t.me/stvnnvs",
127
- copy_code: "stvnnvs 1437",
128
- expiration_time: Date.now() * 999
129
- },
130
- bottom_sheet: {
131
- in_thread_buttons_limit: 2,
132
- divider_indices: [1, 2, 3, 4, 5, 999],
133
- list_title: "stvnnvs",
134
- button_title: "stvnnvs"
135
- },
136
- tap_target_configuration: {
137
- title: " X ",
138
- description: "bomboclard",
139
- canonical_url: "https://t.me/stvnnvs",
140
- domain: "shop.example.com",
141
- button_index: 0
142
- }
143
- }),
144
- buttons: [
145
- {
146
- name: "single_select",
147
- buttonParamsJson: JSON.stringify({
148
- has_multiple_buttons: true
149
- })
150
- },
151
- {
152
- name: "call_permission_request",
153
- buttonParamsJson: JSON.stringify({
154
- has_multiple_buttons: true
155
- })
156
- },
157
- {
158
- name: "single_select",
159
- buttonParamsJson: JSON.stringify({
160
- title: "Hello World",
161
- sections: [
162
- {
163
- title: "title",
164
- highlight_label: "label",
165
- rows: [
166
- {
167
- title: "@stvnnvs",
168
- description: "love you",
169
- id: "row_2"
170
- }
171
- ]
172
- }
173
- ],
174
- has_multiple_buttons: true
175
- })
176
- },
177
- {
178
- name: "cta_copy",
179
- buttonParamsJson: JSON.stringify({
180
- display_text: "copy code",
181
- id: "123456789",
182
- copy_code: "ABC123XYZ"
183
- })
184
- }
185
- ]
186
- }
187
- }
188
- }, { quoted: m });
189
- ```
190
-
191
- ### Interactive Message with Thumbnail
192
- Send interactive messages with thumbnail image and copy button:
193
-
194
- ```javascript
195
- await sock.sendMessage(jid, {
196
- interactiveMessage: {
197
- title: "Hello World",
198
- footer: "telegram: @stvnnvs",
199
- image: { url: "https://example.com/image.jpg" },
200
- buttons: [
201
- {
202
- name: "cta_copy",
203
- buttonParamsJson: JSON.stringify({
204
- display_text: "copy code",
205
- id: "123456789",
206
- copy_code: "ABC123XYZ"
207
- })
208
- }
209
- ]
210
- }
211
- }, { quoted: m });
212
- ```
213
-
214
- ### Product Message
215
- Send product catalog messages with buttons and merchant information:
216
-
217
- ```javascript
218
- await sock.sendMessage(jid, {
219
- productMessage: {
220
- title: "Produk Contoh",
221
- description: "Ini adalah deskripsi produk",
222
- thumbnail: { url: "https://example.com/image.jpg" },
223
- productId: "PROD001",
224
- retailerId: "RETAIL001",
225
- url: "https://example.com/product",
226
- body: "Detail produk",
227
- footer: "Harga spesial",
228
- priceAmount1000: 50000,
229
- currencyCode: "USD",
230
- buttons: [
231
- {
232
- name: "cta_url",
233
- buttonParamsJson: JSON.stringify({
234
- display_text: "Beli Sekarang",
235
- url: "https://example.com/buy"
236
- })
237
- }
238
- ]
239
- }
240
- }, { quoted: m });
241
- ```
242
-
243
- ### Interactive Message with Document Buffer
244
- Send interactive messages with document from buffer (file system) - **Note: Documents only support buffer**:
245
-
246
- ```javascript
247
- await sock.sendMessage(jid, {
248
- interactiveMessage: {
249
- title: "Hello World",
250
- footer: "telegram: @stvnnvs",
251
- document: fs.readFileSync("./package.json"),
252
- mimetype: "application/pdf",
253
- fileName: "stvnnvs.pdf",
254
- jpegThumbnail: fs.readFileSync("./document.jpeg"),
255
- contextInfo: {
256
- mentionedJid: [jid],
257
- forwardingScore: 777,
258
- isForwarded: false
259
- },
260
- externalAdReply: {
261
- title: "shenΕ„ Bot",
262
- body: "anu team",
263
- mediaType: 3,
264
- thumbnailUrl: "https://example.com/image.jpg",
265
- mediaUrl: " X ",
266
- sourceUrl: "https://t.me/stvnnvs",
267
- showAdAttribution: true,
268
- renderLargerThumbnail: false
269
- },
270
- buttons: [
271
- {
272
- name: "cta_url",
273
- buttonParamsJson: JSON.stringify({
274
- display_text: "Telegram",
275
- url: "https://t.me/stvnnvs",
276
- merchant_url: "https://t.me/stvnnvs"
277
- })
278
- }
279
- ]
280
- }
281
- }, { quoted: m });
282
- ```
283
-
284
- ### Interactive Message with Document Buffer (Simple)
285
- Send interactive messages with document from buffer (file system) without contextInfo and externalAdReply - **Note: Documents only support buffer**:
286
-
287
- ```javascript
288
- await sock.sendMessage(jid, {
289
- interactiveMessage: {
290
- title: "Hello World",
291
- footer: "telegram: @stvnnvs",
292
- document: fs.readFileSync("./package.json"),
293
- mimetype: "application/pdf",
294
- fileName: "stvnnvs.pdf",
295
- jpegThumbnail: fs.readFileSync("./document.jpeg"),
296
- buttons: [
297
- {
298
- name: "cta_url",
299
- buttonParamsJson: JSON.stringify({
300
- display_text: "Telegram",
301
- url: "https://t.me/stvnnvs",
302
- merchant_url: "https://t.me/stvnnvs"
303
- })
304
- }
305
- ]
306
- }
307
- }, { quoted: m });
308
- ```
309
-
310
- ### Request Payment Message
311
- Send payment request messages with custom background and sticker:
312
-
313
- ```javascript
314
- let quotedType = m.quoted?.mtype || '';
315
- let quotedContent = JSON.stringify({ [quotedType]: m.quoted }, null, 2);
316
-
317
- await sock.sendMessage(jid, {
318
- requestPaymentMessage: {
319
- currency: "IDR",
320
- amount: 10000000,
321
- from: m.sender,
322
- sticker: JSON.parse(quotedContent),
323
- background: {
324
- id: "100",
325
- fileLength: "0",
326
- width: 1000,
327
- height: 1000,
328
- mimetype: "image/webp",
329
- placeholderArgb: 0xFF00FFFF,
330
- textArgb: 0xFFFFFFFF,
331
- subtextArgb: 0xFFAA00FF
332
- }
333
- }
334
- }, { quoted: m });
335
- ```
336
-
337
- ---
338
-
339
- ## Why Choose WhatsApp Baileys?
340
-
341
- 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.
342
-
343
- ---
344
-
345
- ### Technical Notes
346
-
347
- - Supports custom pairing codes that are stable and secure
348
- - Fixes previous issues related to pairing and authentication
349
- - Features interactive messages and action buttons for dynamic menu creation
350
- - Automatic and efficient session management for long-term stability
351
- - Compatible with the latest multi-device features from WhatsApp
352
- - Easy to integrate and customize based on your needs
353
- - Perfect for developing bots, customer service automation, and other communication applications
354
-
355
- ---
356
-
357
- 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.
358
-
359
- **Thank you for choosing WhatsApp Baileys as your WhatsApp automation solution!**