noya-baileys 6.1.0 → 6.1.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.
Files changed (2) hide show
  1. package/README.md +59 -443
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,480 +1,96 @@
1
- # <div align='center'>Baileys - Typescript/Javascript WhatsApp Web API</div>
1
+ # <div align='center'>Noya Baileys - WhatsApp Web API</div>
2
2
 
3
3
  <p align="center">
4
- <img src="https://i.top4top.io/p_3463no0l00.jpg" alt="Thumbnail" />
4
+ <img src="https://c.top4top.io/p_3761hanoj1.jpg" alt="Noya Baileys" />
5
5
  </p>
6
6
 
7
7
  <div align='center'>
8
8
 
9
- ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/whiskeysockets/baileys/total)
10
- ![NPM Downloads](https://img.shields.io/npm/dw/%40whiskeysockets%2Fbaileys?label=npm&color=%23CB3837)
11
- ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/whiskeysockets/baileys)
12
- ![GitHub License](https://img.shields.io/github/license/whiskeysockets/baileys)
13
- ![Discord](https://img.shields.io/discord/725839806084546610?label=discord&color=%235865F2)
14
- ![GitHub Repo stars](https://img.shields.io/github/stars/whiskeysockets/baileys)
15
- ![GitHub forks](https://img.shields.io/github/forks/whiskeysockets/baileys)
9
+ A powerful TypeScript/JavaScript WhatsApp Web API library for building automation solutions and integrations with WhatsApp. Built on WebSocket technology without requiring a browser instance.
16
10
 
17
11
  </div>
18
12
 
19
- 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.
13
+ ## Features
20
14
 
21
- 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.
15
+ Production-ready features for WhatsApp automation:
22
16
 
23
- 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.
17
+ - Send and receive text messages
18
+ - Send media files (images, videos, audio, documents)
19
+ - Message groups and individual chats
20
+ - User presence and typing indicators
21
+ - Contact management
22
+ - Message reactions
23
+ - Status updates
24
+ - Quote and forward messages
25
+ - Interactive messages with buttons
26
+ - Album messages (multiple images)
27
+ - Poll and event messages
28
+ - Auto-reconnection with exponential backoff
29
+ - Session management and persistence
30
+ - Custom pairing code support (NOYACOMP)
31
+ - Multi-device WhatsApp support
32
+ - Built with TypeScript for type safety
24
33
 
25
- ---
26
-
27
- ### Main Features and Advantages
28
-
29
- - Supports automatic and custom pairing processes
30
- - Fixes previous pairing issues that often caused failures or disconnections
31
- - Supports interactive messages, action buttons, and dynamic menus
32
- - Efficient automatic session management for reliable operation
33
- - Compatible with the latest multi-device features from WhatsApp
34
- - Lightweight, stable, and easy to integrate into various systems
35
- - Suitable for developing bots, automation, and complete communication solutions
36
- - Comprehensive documentation and example codes to facilitate development
37
-
38
- ---
39
-
40
- ## Getting Started
41
-
42
- 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.
43
-
44
- ---
45
-
46
- ## Add Function ( Simple code )
47
-
48
- ### Label Group
49
- Tag/Label Member Grop
50
-
51
- ```javascript
52
- sock.setLabelGroup(jid, string)
53
- ```
54
- ---
55
- ### Check ID Channel
56
- Get ID Channel From Url
57
-
58
- ```javascript
59
- sock.newsletterFromUrl(url)
60
- ```
61
- Result JSON
62
- ```json
63
- {
64
- "name": "Name Channel",
65
- "id": "Channel ID",
66
- "state": "Status Channel",
67
- "subscribers": "Followers",
68
- "verification": "UNVERIFIED",
69
- "creation_time": 1728547155,
70
- "description": "Description Channel"
71
- }
72
- ```
73
- ---
74
- ### Check banned number
75
- You can see the status of blocked numbers here
34
+ ## Installation
76
35
 
77
- ```javascript
78
- sock.checkWhatsApp(jid)
36
+ ```bash
37
+ npm install @noya/baileys
79
38
  ```
80
- ---
81
39
 
82
- ## SendMessage Documentation
40
+ ## Quick Start
83
41
 
84
- ### Status Mention Group & Private Message
85
- Send Status Mention Group/Private Chat
42
+ ```typescript
43
+ import makeWASocket from '@noya/baileys';
86
44
 
87
- ```javascript
88
- await sock.sendStatusMention(content, jid);
89
- ```
90
-
91
- ### Status Group Message V2
92
- Send Group Status With Version 2
45
+ const sock = makeWASocket();
93
46
 
94
- ```javascript
95
- await sock.sendMessage(jid, {
96
- groupStatusMessage: {
97
- text: "Hello World"
98
- }
47
+ sock.ev.on('connection.update', (update) => {
48
+ const { connection, lastDisconnect } = update;
49
+ if (connection === 'open') {
50
+ console.log('Connected to WhatsApp');
51
+ }
99
52
  });
100
- ```
101
-
102
- ### Album Message (Multiple Images)
103
- Send multiple images in a single album message:
104
53
 
105
- ```javascript
106
- await sock.sendMessage(jid, {
107
- albumMessage: [
108
- { image: haii, caption: "Foto pertama" },
109
- { image: { url: "URL IMAGE" }, caption: "Foto kedua" }
110
- ]
111
- }, { quoted: m });
112
- ```
113
-
114
- ### Event Message
115
- Create and send WhatsApp event invitations:
116
-
117
- ```javascript
118
- await sock.sendMessage(jid, {
119
- eventMessage: {
120
- isCanceled: false,
121
- name: "Hello World",
122
- description: "noya",
123
- location: {
124
- degreesLatitude: 0,
125
- degreesLongitude: 0,
126
- name: "rowrrrr"
127
- },
128
- joinLink: "https://call.whatsapp.com/video/noya",
129
- startTime: "1763019000",
130
- endTime: "1763026200",
131
- extraGuestsAllowed: false
132
- }
133
- }, { quoted: m });
134
- ```
135
-
136
- ### Poll Result Message
137
- Display poll results with vote counts:
138
-
139
- ```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 });
155
- ```
156
-
157
- ### Simple Interactive Message
158
- Send basic interactive messages with copy button functionality:
159
-
160
- ```javascript
161
- await sock.sendMessage(jid, {
162
- interactiveMessage: {
163
- header: "Hello World",
164
- title: "Hello World",
165
- footer: "telegram: @noya ",
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 });
178
- ```
179
-
180
- ### Interactive Message with Native Flow
181
- Send interactive messages with buttons, copy actions, and native flow features:
182
-
183
- ```javascript
184
- await sock.sendMessage(jid, {
185
- interactiveMessage: {
186
- header: "Hello World",
187
- title: "Hello World",
188
- footer: "telegram: @noya4u_27",
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/noya",
195
- copy_code: "noya",
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: "noya",
202
- button_title: "noya"
203
- },
204
- tap_target_configuration: {
205
- title: " X ",
206
- description: "bomboclard",
207
- canonical_url: "https://t.me/noya",
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: "@noya",
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 });
257
- ```
258
-
259
- ### Interactive Message with Thumbnail
260
- Send interactive messages with thumbnail image and copy button:
261
-
262
- ```javascript
263
- await sock.sendMessage(jid, {
264
- interactiveMessage: {
265
- header: "Hello World",
266
- title: "Hello World",
267
- footer: "telegram: @noya",
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 });
281
- ```
282
-
283
- ### Product Message
284
- Send product catalog messages with buttons and merchant information:
285
-
286
- ```javascript
287
- await sock.sendMessage(jid, {
288
- 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 });
310
- ```
311
-
312
- ### Interactive Message with Document Buffer
313
- Send interactive messages with document from buffer (file system) - **Note: Documents only support buffer**:
314
-
315
- ```javascript
316
- await sock.sendMessage(jid, {
317
- interactiveMessage: {
318
- header: "Hello World",
319
- title: "Hello World",
320
- footer: "telegram: @noya",
321
- document: fs.readFileSync("./package.json"),
322
- mimetype: "application/pdf",
323
- fileName: "noya.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/noya",
337
- showAdAttribution: true,
338
- renderLargerThumbnail: false
339
- },
340
- buttons: [
341
- {
342
- name: "cta_url",
343
- buttonParamsJson: JSON.stringify({
344
- display_text: "Telegram",
345
- url: "https://t.me/noya",
346
- merchant_url: "https://t.me/noya"
347
- })
348
- }
349
- ]
350
- }
351
- }, { quoted: m });
352
- ```
353
-
354
- ### Interactive Message with Document Buffer (Simple)
355
- Send interactive messages with document from buffer (file system) without contextInfo and externalAdReply - **Note: Documents only support buffer**:
356
-
357
- ```javascript
358
- await sock.sendMessage(jid, {
359
- interactiveMessage: {
360
- header: "Hello World",
361
- title: "Hello World",
362
- footer: "telegram: @noya",
363
- document: fs.readFileSync("./package.json"),
364
- mimetype: "application/pdf",
365
- fileName: "noya.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/noya",
373
- merchant_url: "https://t.me/noya"
374
- })
375
- }
376
- ]
377
- }
378
- }, { quoted: m });
54
+ sock.ev.on('messages.upsert', async (m) => {
55
+ const msg = m.messages[0];
56
+ if (!msg.key.fromMe) {
57
+ await sock.sendMessage(msg.key.remoteJid, {
58
+ text: 'Hello! Thanks for your message.'
59
+ });
60
+ }
61
+ });
379
62
  ```
380
63
 
381
- ### Request Payment Message
382
- Send payment request messages with custom background and sticker:
64
+ ## Documentation
383
65
 
384
- ```javascript
385
- let quotedType = m.quoted?.mtype || '';
386
- let quotedContent = JSON.stringify({ [quotedType]: m.quoted }, null, 2);
66
+ For detailed documentation and API reference, visit the project repository.
387
67
 
388
- await sock.sendMessage(jid, {
389
- 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 });
406
- ```
68
+ ## Requirements
407
69
 
408
- ---
70
+ - Node.js 14 or higher
71
+ - A WhatsApp account
72
+ - Chrome, Edge, or Firefox browser installed
409
73
 
410
- ## Why Choose WhatsApp Baileys?
74
+ ## Disclaimer
411
75
 
412
- 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.
76
+ This library is an unofficial implementation. Use responsibly and in compliance with WhatsApp's Terms of Service.
413
77
 
414
- ---
78
+ ## Support and Contact
415
79
 
416
- ### Technical Notes
80
+ For support and inquiries, reach out through:
417
81
 
418
- - Supports custom pairing codes that are stable and secure
419
- - Fixes previous issues related to pairing and authentication
420
- - Features interactive messages and action buttons for dynamic menu creation
421
- - Automatic and efficient session management for long-term stability
422
- - Compatible with the latest multi-device features from WhatsApp
423
- - Easy to integrate and customize based on your needs
424
- - 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)
82
+ - Telegram: https://t.me/noya4u_27
83
+ - GitHub: https://github.com/malfurra
84
+ - Other socials: malfurra
426
85
 
427
- ---
86
+ ## License
428
87
 
429
- 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.
88
+ MIT License - See LICENSE file for details
430
89
 
431
- **Thank you for choosing WhatsApp Baileys as your WhatsApp automation solution!**
90
+ ## Contributing
432
91
 
92
+ Contributions are welcome. Please fork the repository and submit pull requests with your improvements.
433
93
 
434
94
  ---
435
95
 
436
-
437
- ### Contact Developer
438
-
439
- For questions, support, or collaboration, feel free to contact the developer:
440
-
441
- - **Telegram**: [Telegram Contact](https://t.me/noya)
442
- - **Channel WhatsApp**: [Channel WhatsApp](https://whatsapp.com/channel/0029Vb3IiqTL7UVP9A9n0w1x)
443
-
444
- ### 🙌 Contributors outside the Baileys code
445
-
446
- Thanks to the following awesome contributors who help improve this project 💖
447
-
448
- <table>
449
- <tr>
450
- <td align="center">
451
- <a href="https://github.com/noya">
452
- <img src="https://github.com/noya.png" width="80px;" style="border-radius:50%;" alt="Developer"/>
453
- <br />
454
- <sub><b>Noya</b></sub>
455
- </a>
456
- </td>
457
- <td align="center">
458
- <a href="https://github.com/z4phdev">
459
- <img src="https://github.com/z4phdev.png" width="80px;" style="border-radius:50%;" alt="Developer"/>
460
- <br />
461
- <sub><b>z4phdev</b></sub>
462
- </a>
463
- </td>
464
- <td align="center">
465
- <a href="https://github.com/kiuur">
466
- <img src="https://github.com/kiuur.png" width="80px;" style="border-radius:50%;" alt="Contributor"/>
467
- <br />
468
- <sub><b>KyuuRzy</b></sub>
469
- </a>
470
- </td>
471
- <td align="center">
472
- <a href="https://github.com/RexxHayanasi">
473
- <img src="https://github.com/RexxHayanasi.png" width="80px;" style="border-radius:50%;" alt="Contributor"/>
474
- <br />
475
- <sub><b>RexxHayanasi</b></sub>
476
- </a>
477
- </td>
478
- </tr>
479
- </table>
480
-
96
+ Developed and maintained by the Baileys community.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noya-baileys",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "description": "WhatsApp API Modification",
5
5
  "keywords": [
6
6
  "whatsapp",