zaileys 1.1.40-tx.6 → 1.1.40-tx.9

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 ADDED
@@ -0,0 +1,713 @@
1
+ <div align="center">
2
+ <img alt="Zaileys - Simplified WhatsApp Node.js TypeScript/JavaScript API" src="https://socialify.git.ci/zeative/zaileys/image?custom_description=Simplified+WhatsApp+Node.js+TypeScript%2FJavaScript+API&custom_language=TypeScript&description=1&font=Inter&language=1&owner=1&pattern=Charlie+Brown&theme=Auto">
3
+
4
+ <h1 align="center">Zaileys - Simplified WhatsApp Node.js TypeScript/JavaScript API</h1>
5
+
6
+ <a href="https://www.npmjs.com/package/zaileys"><img src="https://img.shields.io/npm/v/zaileys.svg" alt="NPM Version"></a>
7
+ <a href="https://www.npmjs.com/package/zaileys"><img src="https://img.shields.io/npm/dw/zaileys?label=npm&color=%23CB3837" alt="NPM Downloads"></a>
8
+ <a href="https://github.com/zeative/zaileys/releases"><img src="https://img.shields.io/npm/dt/zaileys" alt="NPM Downloads"></a>
9
+ <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/github/languages/code-size/zeative/zaileys" alt="GitHub Code Size"></a>
10
+ <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/badge/TypeScript-5.0%2B-blue?style=flat-square&logo=typescript" alt="TypeScript"></a>
11
+ <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/github/license/zeative/zaileys" alt="GitHub License"></a>
12
+ <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/github/stars/zeative/zaileys" alt="GitHub Stars"></a>
13
+ <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/github/forks/zeative/zaileys" alt="GitHub Forks"></a>
14
+
15
+ </div>
16
+
17
+ <div align="center">
18
+ <p>
19
+ <b>Zaileys</b> is a powerful, type-safe wrapper around Baileys, designed to simplify the development of WhatsApp bots. It provides a robust architecture with built-in state management, middleware support, and easy-to-use event handlers, making it perfect for building scalable and maintainable WhatsApp applications.
20
+ </p>
21
+ </div>
22
+
23
+ <br>
24
+
25
+ <div align="center">
26
+
27
+ [🚀 Overview](#-overview) &nbsp;&nbsp;â€ĸ&nbsp;&nbsp;
28
+ [đŸĒļ Features](#-features) &nbsp;&nbsp;â€ĸ&nbsp;&nbsp;
29
+ [đŸ“Ļ Installation](#-installation) &nbsp;&nbsp;â€ĸ&nbsp;&nbsp;
30
+ [⚡ Quick Start](#-quick-start) &nbsp;&nbsp;â€ĸ&nbsp;&nbsp;
31
+ [📨 Sending Messages](#-sending-messages) &nbsp;&nbsp;â€ĸ&nbsp;&nbsp;
32
+ [đŸ‘Ĩ Group Management](#-group-management) &nbsp;&nbsp;â€ĸ&nbsp;&nbsp;
33
+ [🧩 Plugins](#-plugins) &nbsp;&nbsp;â€ĸ&nbsp;&nbsp;
34
+ [🤝 Contributing](#-contributing)
35
+
36
+ </div>
37
+
38
+ <br>
39
+
40
+ ---
41
+
42
+ ## 🚀 Overview
43
+
44
+ > Zaileys solves the complexity of managing raw WhatsApp socket connections by providing a high-level, opinionated API. It is built for developers who need to create bots, customer support agents, or automated notification systems without getting bogged down in protocol details.
45
+
46
+ Targeting **Node.js** and **TypeScript** developers, Zaileys integrates essential features like rate limiting, session management, and input validation out of the box.
47
+
48
+ ## đŸĒļ Features
49
+
50
+ - đŸ›Ąī¸ **Type-Safe** - Full TypeScript + Zod validation with autocomplete
51
+ - 🏓 **Middleware** - Intercept and process events globally
52
+ - 🧩 **Plugin System** - Drop-in file-based plugins
53
+ - 💾 **State Management** - Built-in `lowdb` for data persistence
54
+ - 🔔 **Event-Driven** - Clean listeners for `connection`, `messages`, `calls`
55
+ - đŸ“ĸ **Rate Limiting** - Anti-spam protection out of the box
56
+ - 🤖 **Auto-Everything** - Auto-read, auto-reject calls, auto-mentions
57
+ - 📲 **Multi-Device** - QR code or Pairing Code authentication
58
+ - đŸŽŦ **Built-in FFmpeg** - No external dependencies for media processing
59
+ - 🔘 **Interactive Buttons** - Simple buttons, URL, copy code, call buttons, and lists
60
+
61
+ ## 🎨 Concepts & Architecture
62
+
63
+ **Client** - Your bot's brain. Manages connections, events, and the entire lifecycle.
64
+
65
+ **Context** - Rich event objects with all the data and helpers you need.
66
+
67
+ **Middleware** - Pre-process events for logging, auth, spam filtering, or custom logic.
68
+
69
+ **Plugins** - Drop files in `plugins/` directory. Auto-loaded, zero config.
70
+
71
+ **Store** - JSON database (`lowdb`) that auto-syncs chats, contacts, and messages.
72
+
73
+ ## đŸ“Ļ Installation
74
+
75
+ Install `zaileys` using your preferred package manager:
76
+
77
+ ```bash
78
+ npm install zaileys
79
+ # or
80
+ pnpm add zaileys
81
+ # or
82
+ yarn add zaileys
83
+ ```
84
+
85
+ > **Note**: Requires Node.js v20+ and TypeScript for best experience.
86
+
87
+ > **FFmpeg**: No need to install FFmpeg separately! It's already bundled with Zaileys for seamless media processing (audio, video, stickers).
88
+
89
+ ## ⚡ Quick Start
90
+
91
+ Here is a minimal example to get your bot running with QR code authentication:
92
+
93
+ ```typescript
94
+ import { Client } from 'zaileys';
95
+
96
+ const wa = new Client({
97
+ authType: 'qr',
98
+ });
99
+
100
+ wa.on('messages', async (ctx) => {
101
+ if (ctx.text == 'ping') {
102
+ await wa.send(ctx.roomId, 'Pong! 🏓');
103
+ }
104
+ });
105
+ ```
106
+
107
+ ## đŸ› ī¸ Configuration
108
+
109
+ The `Client` constructor accepts a configuration object. Below are the valid options based on the library's type definitions.
110
+
111
+ ### General Options
112
+
113
+ These options apply to both authentication methods:
114
+
115
+ | Option | Type | Default | Description |
116
+ | :---------------- | :-------- | :---------- | :-------------------------------------- |
117
+ | `session` | `string` | `'zaileys'` | Name of the session folder. |
118
+ | `prefix` | `string` | `undefined` | Command prefix (e.g., `'/'`). |
119
+ | `showLogs` | `boolean` | `true` | Enable internal logging. |
120
+ | `ignoreMe` | `boolean` | `true` | Ignore messages sent by the bot itself. |
121
+ | `syncFullHistory` | `boolean` | `true` | Sync full chat history on startup. |
122
+
123
+ ### Automation Options
124
+
125
+ | Option | Type | Default | Description |
126
+ | :--------------- | :-------- | :------ | :--------------------------------------------------------- |
127
+ | `autoRead` | `boolean` | `true` | Automatically mark messages as read. |
128
+ | `autoOnline` | `boolean` | `true` | Automatically set presence to online. |
129
+ | `autoPresence` | `boolean` | `true` | Automatically send presence updates (composing/recording). |
130
+ | `autoMentions` | `boolean` | `true` | Automatically handle mentions. |
131
+ | `autoRejectCall` | `boolean` | `true` | Automatically reject incoming calls. |
132
+
133
+ ### Advanced Configuration
134
+
135
+ | Option | Type | Description |
136
+ | :---------- | :------- | :------------------------------------------------------------------------------ |
137
+ | `limiter` | `object` | Rate limiting configuration. Default: `maxMessages: 20, durationMs: 10_000`. |
138
+ | `fakeReply` | `object` | Configuration for fake reply provider. |
139
+ | `sticker` | `object` | Default metadata for sticker creation (`packageName`, `authorName`, `quality`). |
140
+ | `citation` | `object` | Custom citation sources. |
141
+
142
+ ## 💡 Advanced Usage
143
+
144
+ ### Middleware & Spam Protection
145
+
146
+ You can use middleware to filter messages or add custom logic before your handlers run.
147
+
148
+ ```typescript
149
+ wa.use(async (ctx, next) => {
150
+ if (ctx.messages.isSpam) {
151
+ console.warn(`Spam detected from ${ctx.messages.senderName}`);
152
+ return;
153
+ }
154
+
155
+ await next();
156
+ });
157
+ ```
158
+
159
+ ### 🧩 Plugins
160
+
161
+ Zaileys features a built-in file-based plugin system. By default, it looks for plugins in the `plugins` directory of your project root.
162
+
163
+ **1. Create a plugin file** (e.g., `plugins/hello.ts`):
164
+
165
+ ```typescript
166
+ import { definePlugins } from 'zaileys';
167
+
168
+ export default definePlugins(
169
+ async (wa, ctx) => {
170
+ await wa.send(ctx.roomId, 'Hello from plugin!');
171
+ },
172
+ {
173
+ matcher: ['/hello', '!hello'], // Trigger commands
174
+ metadata: {
175
+ description: 'A simple hello world plugin',
176
+ },
177
+ },
178
+ );
179
+ ```
180
+
181
+ **2. That's it!** The client automatically loads and executes plugins that match the incoming message.
182
+
183
+ **3. Extract plugin information** (optional):
184
+
185
+ ```typescript
186
+ const pluginsInfo = wa.plugins.getPluginsInfo();
187
+
188
+ /* Example output
189
+ [
190
+ {
191
+ matcher: ['/hello', '!hello'],
192
+ metadata: {
193
+ description: 'A simple hello world plugin',
194
+ },
195
+ }
196
+ ]
197
+ */
198
+ ```
199
+
200
+ This returns an array of all loaded plugins with their `matcher` and `metadata`, useful for generating help menus or listing available commands.
201
+
202
+ ### 🔐 Citation (Custom Authorization)
203
+
204
+ Citation allows you to define custom authorization logic by creating named checkers that verify if a user is in a specific list (e.g., premium users, banned users).
205
+
206
+ **1. Configure citation sources** in the client options:
207
+
208
+ ```typescript
209
+ const wa = new Client({
210
+ authType: 'qr',
211
+ citation: {
212
+ premium: async () => {
213
+ // const numbers = await fetch...
214
+ return [6280000000, 12388888888];
215
+ },
216
+ banned: async () => {
217
+ return [6285555555555];
218
+ },
219
+ },
220
+ });
221
+ ```
222
+
223
+ **2. Use citation in your message handlers**:
224
+
225
+ ```typescript
226
+ wa.on('messages', async (ctx) => {
227
+ const isBanned = await ctx.citation.banned();
228
+ const isPremium = await ctx.citation.premium();
229
+
230
+ if (isBanned) return;
231
+
232
+ if (isPremium) {
233
+ await wa.send(ctx.roomId, 'Premium feature unlocked!');
234
+ }
235
+ });
236
+ ```
237
+
238
+ Each citation function returns `true` if the sender matches any ID in the returned list, `false` otherwise.
239
+
240
+ **How it works:**
241
+
242
+ Citation functions return an array of phone numbers, group id and lid Internally, Zaileys compares the sender's ID against this list by checking:
243
+
244
+ - `roomId` - The chat/group ID
245
+ - `senderId` - The sender's WhatsApp ID
246
+ - `senderLid` - The sender's LID
247
+
248
+ If any of these match a number in your returned array, the citation check returns `true`. This makes it flexible for both individual chats and group scenarios.
249
+
250
+ ## đŸ“Ģ Sending Messages
251
+
252
+ > **Quick Jump:** [Text](#send-text) ¡ [Reply](#reply-to-message) ¡ [Forward](#forward-message) ¡ [Media](#send-media) ¡ [Banner](#send-with-banner) ¡ [Location](#send-location) ¡ [Contact](#send-contact) ¡ [Poll](#send-poll) ¡ [Reaction](#send-reaction) ¡ [Presence](#update-presence) ¡ [Mentions](#mentions) ¡ [Edit & Delete](#edit--delete-messages) ¡ [Buttons](#interactive-buttons)
253
+
254
+ ### Send Text
255
+
256
+ Send a simple text message to any chat.
257
+
258
+ ```typescript
259
+ await wa.send(ctx.roomId, 'Hello World!');
260
+
261
+ await wa.send(ctx.roomId, {
262
+ text: 'Hello with options!',
263
+ });
264
+ ```
265
+
266
+ ### Reply to Message
267
+
268
+ Reply to a specific message using the `replied` option.
269
+
270
+ ```typescript
271
+ await wa.send(ctx.roomId, {
272
+ text: 'This is a reply!',
273
+ replied: ctx.message(),
274
+ });
275
+ ```
276
+
277
+ ### Forward Message
278
+
279
+ Forward message to any chat.
280
+
281
+ ```typescript
282
+ await wa.forward(ctx.roomId, {
283
+ text: 'Forwarded message',
284
+ isForwardedMany: true,
285
+ });
286
+ ```
287
+
288
+ ### Send Media
289
+
290
+ Send images, videos, audio, stickers, or documents. Media can be a URL, Buffer, or base64 string.
291
+
292
+ **Image:**
293
+
294
+ ```typescript
295
+ await wa.send(ctx.roomId, {
296
+ image: 'https://example.com/image.jpg',
297
+ caption: 'Check this out!',
298
+ });
299
+
300
+ await wa.send(ctx.roomId, {
301
+ image: fs.readFileSync('./image.jpg'),
302
+ caption: 'Image from buffer',
303
+ isViewOnce: true,
304
+ });
305
+ ```
306
+
307
+ **Video:**
308
+
309
+ ```typescript
310
+ await wa.send(ctx.roomId, {
311
+ video: 'https://example.com/video.mp4',
312
+ caption: 'Cool video!',
313
+ ptv: true,
314
+ });
315
+ ```
316
+
317
+ **Audio:**
318
+
319
+ ```typescript
320
+ await wa.send(ctx.roomId, {
321
+ audio: 'https://example.com/audio.mp3',
322
+ ptt: true,
323
+ });
324
+ ```
325
+
326
+ **Sticker:**
327
+
328
+ ```typescript
329
+ // support gif and video
330
+ await wa.send(ctx.roomId, {
331
+ sticker: 'https://example.com/sticker.mp4',
332
+ });
333
+ ```
334
+
335
+ **Document:**
336
+
337
+ ```typescript
338
+ await wa.send(ctx.roomId, {
339
+ document: 'https://example.com/file.pdf',
340
+ fileName: 'document.pdf',
341
+ caption: 'Here is the file',
342
+ });
343
+ ```
344
+
345
+ ### Send with Banner
346
+
347
+ Send messages with an external ad reply banner (link preview).
348
+
349
+ ```typescript
350
+ await wa.send(ctx.roomId, {
351
+ text: 'Banner message!',
352
+ banner: {
353
+ thumbnailUrl: 'https://github.com/zeative.png',
354
+ sourceUrl: 'https://jaa.web.id',
355
+ title: 'Test Banner',
356
+ body: 'Hello World!',
357
+ },
358
+ });
359
+ ```
360
+
361
+ ### Send Location
362
+
363
+ Send location with coordinates.
364
+
365
+ ```typescript
366
+ await wa.send(ctx.roomId, {
367
+ location: {
368
+ latitude: -6.2,
369
+ longitude: 106.816666,
370
+ title: 'Jakarta',
371
+ footer: 'Capital of Indonesia',
372
+ url: 'https://maps.google.com/?q=-6.200000,106.816666',
373
+ },
374
+ });
375
+ ```
376
+
377
+ ### Send Contact
378
+
379
+ Send one or multiple contacts.
380
+
381
+ ```typescript
382
+ await wa.send(ctx.roomId, {
383
+ title: 'My Contacts',
384
+ contacts: [
385
+ {
386
+ fullname: 'John Doe',
387
+ phoneNumber: 6281234567890,
388
+ organization: 'Company Inc.',
389
+ },
390
+ {
391
+ fullname: 'Jane Smith',
392
+ phoneNumber: 6289876543210,
393
+ },
394
+ ],
395
+ });
396
+ ```
397
+
398
+ ### Send Poll
399
+
400
+ Create a poll with multiple options.
401
+
402
+ ```typescript
403
+ await wa.send(ctx.roomId, {
404
+ poll: {
405
+ name: 'What is your favorite color?',
406
+ answers: ['Red', 'Blue', 'Green', 'Yellow'],
407
+ isMultiple: false,
408
+ },
409
+ });
410
+ ```
411
+
412
+ ### Send Reaction
413
+
414
+ React to a message with an emoji.
415
+
416
+ ```typescript
417
+ await wa.reaction(ctx.message(), '👍');
418
+
419
+ await wa.reaction(ctx.message(), 'â¤ī¸');
420
+ ```
421
+
422
+ ### Update Presence
423
+
424
+ Update your presence status in a chat.
425
+
426
+ ```typescript
427
+ await wa.presence(ctx.roomId, 'typing');
428
+
429
+ await wa.presence(ctx.roomId, 'recording');
430
+ ```
431
+
432
+ ### Mentions
433
+
434
+ Mentions are automatically detected when `autoMentions` is enabled (default: `true`).
435
+
436
+ ```typescript
437
+ // support lid
438
+ await wa.send(ctx.roomId, 'Hello @6281234567890!');
439
+ ```
440
+
441
+ ### Edit & Delete Messages
442
+
443
+ **Edit message:**
444
+
445
+ ```typescript
446
+ const sent = await wa.send(ctx.roomId, 'Original text');
447
+
448
+ setTimeout(async () => {
449
+ await wa.edit(sent, 'Edited text');
450
+ }, 2000);
451
+ ```
452
+
453
+ **Delete message:**
454
+
455
+ ```typescript
456
+ const sent = await wa.send(ctx.roomId, 'This will be deleted');
457
+
458
+ setTimeout(async () => {
459
+ await wa.delete(sent);
460
+ }, 2000);
461
+
462
+ // or multiple messages
463
+ await wa.delete([sent1, sent2]);
464
+ ```
465
+
466
+ ### Interactive Buttons
467
+
468
+ Send messages with interactive buttons.
469
+
470
+ **Simple Buttons:**
471
+
472
+ > ✅ Simple button has support Android/iPhone/Desktop
473
+
474
+ ```typescript
475
+ await wa.button(ctx.roomId, {
476
+ text: 'Choose an option:',
477
+ buttons: {
478
+ type: 'simple',
479
+ footer: 'Footer text',
480
+ data: [
481
+ { id: 'btn1', text: 'Option 1' },
482
+ { id: 'btn2', text: 'Option 2' },
483
+ { id: 'btn3', text: 'Option 3' },
484
+ ],
485
+ },
486
+ });
487
+ ```
488
+
489
+ **Interactive Buttons:**
490
+
491
+ > âš ī¸ Experimental, only support Android/iPhone
492
+
493
+ ```typescript
494
+ await wa.button(ctx.roomId, {
495
+ text: 'Interactive menu:',
496
+ buttons: {
497
+ type: 'interactive',
498
+ footer: 'Footer text',
499
+ data: [
500
+ { type: 'quick_reply', id: 'reply1', text: 'Quick Reply' },
501
+ { type: 'cta_url', text: 'Visit Website', url: 'https://example.com' },
502
+ { type: 'cta_copy', id: 'copy1', text: 'Copy Code', copy: 'PROMO123' },
503
+ { type: 'cta_call', text: 'Call Us', phoneNumber: '+6281234567890' },
504
+ ],
505
+ },
506
+ });
507
+ ```
508
+
509
+ **Lists Buttons:**
510
+
511
+ > âš ī¸ Experimental, not supported on some devices. Don't use in production!
512
+
513
+ ```typescript
514
+ await wa.button(ctx.roomId, {
515
+ text: 'Choose an option:',
516
+ buttons: {
517
+ type: 'interactive',
518
+ footer: 'Footer text',
519
+ data: [
520
+ {
521
+ type: 'single_select',
522
+ text: 'Choose an option:',
523
+ section: [
524
+ {
525
+ title: 'Section 1',
526
+ rows: [
527
+ { id: 'btn1', title: 'Option 1' },
528
+ { id: 'btn2', title: 'Option 2' },
529
+ { id: 'btn3', title: 'Option 3' },
530
+ ],
531
+ },
532
+ ],
533
+ },
534
+ ],
535
+ },
536
+ });
537
+ ```
538
+
539
+ ## đŸ‘Ĩ Group Management
540
+
541
+ > **Quick Jump:** [Create](#create-group) ¡ [Participants](#manage-participants) ¡ [Profile](#group-profile) ¡ [Settings](#group-settings) ¡ [Invite Code](#invite-code) ¡ [Metadata](#group-metadata) ¡ [Join Requests](#join-requests) ¡ [Fetch All](#fetch-all-groups) ¡ [Ephemeral](#ephemeral-messages) ¡ [Leave](#leave-group)
542
+
543
+ Manage groups, participants, and settings easily.
544
+
545
+ ### Create Group
546
+
547
+ Create a new group with initial participants.
548
+
549
+ ```typescript
550
+ // Create group with name and participants
551
+ const group = await wa.group.create('My Group', [6281234567890, 6289876543210]);
552
+ console.log('Group created:', group);
553
+ ```
554
+
555
+ ### Manage Participants
556
+
557
+ Add, remove, promote, or demote participants.
558
+
559
+ ```typescript
560
+ const groupId = '1234567890@g.us';
561
+
562
+ // Add participants
563
+ await wa.group.participant(groupId, [6281234567890], 'add');
564
+
565
+ // Remove participants
566
+ await wa.group.participant(groupId, [6281234567890], 'remove');
567
+
568
+ // Promote to admin
569
+ await wa.group.participant(groupId, [6281234567890], 'promote');
570
+
571
+ // Demote to member
572
+ await wa.group.participant(groupId, [6281234567890], 'demote');
573
+ ```
574
+
575
+ ### Group Profile
576
+
577
+ Update group subject, description, or icon.
578
+
579
+ ```typescript
580
+ // Update subject
581
+ await wa.group.profile(groupId, 'New Group Name', 'subject');
582
+
583
+ // Update description
584
+ await wa.group.profile(groupId, 'This is the new description', 'description');
585
+
586
+ // Update group avatar (from URL or Buffer)
587
+ await wa.group.profile(groupId, 'https://example.com/icon.jpg', 'avatar');
588
+ ```
589
+
590
+ ### Group Settings
591
+
592
+ Configure group permissions.
593
+
594
+ ```typescript
595
+ // All members can send messages
596
+ await wa.group.setting(groupId, 'open');
597
+
598
+ // Only admins can send messages
599
+ await wa.group.setting(groupId, 'close');
600
+
601
+ // Only admins can edit group info
602
+ await wa.group.setting(groupId, 'locked');
603
+
604
+ // All members can edit group info
605
+ await wa.group.setting(groupId, 'unlocked');
606
+
607
+ // Only admins can add members
608
+ await wa.group.setting(groupId, 'admin_add');
609
+
610
+ // All members can add members
611
+ await wa.group.setting(groupId, 'all_member_add');
612
+ ```
613
+
614
+ ### Invite Code
615
+
616
+ Manage group invite links.
617
+
618
+ ```typescript
619
+ // Get current invite code
620
+ const code = await wa.group.inviteCode(groupId, 'code');
621
+ console.log('Invite link:', `https://chat.whatsapp.com/${code}`);
622
+
623
+ // Revoke invite code
624
+ await wa.group.inviteCode(groupId, 'revoke');
625
+
626
+ // Get invite info
627
+ const info = await wa.group.inviteCode('INVITE_CODE', 'info');
628
+
629
+ // Join group via invite code
630
+ await wa.group.inviteCode('INVITE_CODE', 'accept');
631
+ ```
632
+
633
+ ### Group Metadata
634
+
635
+ Get full group metadata.
636
+
637
+ ```typescript
638
+ const metadata = await wa.group.metadata(groupId);
639
+ console.log(metadata);
640
+ ```
641
+
642
+ ### Join Requests
643
+
644
+ Manage pending join requests.
645
+
646
+ ```typescript
647
+ // Get list of pending requests
648
+ const requests = await wa.group.requestJoinList(groupId);
649
+
650
+ // Approve requests
651
+ await wa.group.requestJoin(groupId, [6281234567890], 'approve');
652
+
653
+ // Reject requests
654
+ await wa.group.requestJoin(groupId, [6281234567890], 'reject');
655
+ ```
656
+
657
+ ### Fetch All Groups
658
+
659
+ Get all groups the bot is part of.
660
+
661
+ ```typescript
662
+ const groups = await wa.group.fetchAllGroups();
663
+ console.log('Joined groups:', Object.keys(groups).length);
664
+ ```
665
+
666
+ ### Ephemeral Messages
667
+
668
+ Set disappearing messages in groups.
669
+
670
+ ```typescript
671
+ // Turn off disappearing messages
672
+ await wa.group.ephemeral(groupId, 'off');
673
+
674
+ // Set to 24 hours
675
+ await wa.group.ephemeral(groupId, '24h');
676
+
677
+ // Set to 7 days
678
+ await wa.group.ephemeral(groupId, '7d');
679
+
680
+ // Set to 90 days
681
+ await wa.group.ephemeral(groupId, '90d');
682
+ ```
683
+
684
+ ### Leave Group
685
+
686
+ Leave group.
687
+
688
+ ```typescript
689
+ await wa.group.leave(groupId);
690
+ ```
691
+
692
+ ## 🤝 Contributing
693
+
694
+ Contributions are welcome! Please follow these steps:
695
+
696
+ 1. Fork the repository.
697
+ 2. Create new branch: `git checkout -b feature/my-feature`.
698
+ 3. Commit your changes: `git commit -m 'Add some feature'`.
699
+ 4. Push to the branch: `git push origin feature/my-feature`.
700
+ 5. Open Pull Request.
701
+
702
+ ### đŸŽ¯ Issues & Feedback
703
+
704
+ **If you encounter any problems or have feature requests, please open an [issue](https://github.com/zeative/zaileys/issues)**
705
+
706
+ - [Buy me coffee ☕](https://saweria.co/zaadevofc)
707
+ - [Ko-Fi](https://ko-fi.com/zaadevofc)
708
+ - [Trakteer](https://trakteer.id/zaadevofc)
709
+ - ⭐ Star the repo on GitHub
710
+
711
+ ### 📜 License
712
+
713
+ Distributed under the **MIT License**. See [`LICENSE`](https://github.com/zeative/zaileys/blob/main/LICENSE) for details.