zaileys 1.1.33 β†’ 1.1.34

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 CHANGED
@@ -1,52 +1,100 @@
1
- <h1 align="center">Zaileys - Simplified WhatsApp Node.js API</h1>
2
-
3
1
  <div align="center">
4
2
  <img alt="Zaileys - Simplified WhatsApp Node.js API" src="https://socialify.git.ci/zeative/zaileys/image?description=1&descriptionEditable=Zaileys%20is%20a%20simplified%20version%20of%20the%20Baileys%20package%20%0Awhich%20is%20easier%20and%20faster.&font=KoHo&forks=1&issues=1&language=1&name=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Auto">
5
- <br>
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"><img src="https://img.shields.io/github/languages/code-size/zeative/zaileys" alt="GitHub Code Size"></a>
9
- <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/github/license/zeative/zaileys" alt="GitHub License"></a>
10
- <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/github/stars/zeative/zaileys" alt="GitHub Stars"></a>
11
- <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/github/forks/zeative/zaileys" alt="GitHub Forks"></a>
12
- </div>
13
-
14
- #
15
- **Zaileys** is a lightweight, user-friendly wrapper around the [Baileys](https://github.com/WhiskeySockets/Baileys) library, designed to simplify building WhatsApp bots and integrations with TypeScript or ESM JavaScript. It offers a streamlined API, robust multi-device support, and seamless database integration for session management.
16
-
17
- > **Note**: Stay updated and get support by joining our [WhatsApp Channel](https://whatsapp.com/channel/0029VazENbmInlqHIWzgn33h).
18
3
 
19
- > **Warning**: Pairing code authentication is currently not supported due to issues. Use QR code authentication instead.
4
+ <h1 align="center">Zaileys - Simplified WhatsApp Node.js API</h1>
20
5
 
21
- ## πŸ“‹ Table of Contents
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"><img src="https://img.shields.io/github/languages/code-size/zeative/zaileys" alt="GitHub Code Size"></a>
9
+ <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/github/license/zeative/zaileys" alt="GitHub License"></a>
10
+ <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/github/stars/zeative/zaileys" alt="GitHub Stars"></a>
11
+ <a href="https://github.com/zeative/zaileys"><img src="https://img.shields.io/github/forks/zeative/zaileys" alt="GitHub Forks"></a>
22
12
 
23
- 1. [✨ Features](#features)
24
- 2. [πŸ“¦ Installation](#installation)
25
- 3. [πŸš€ Quick Start](#quick-start)
26
- 4. [πŸ›  Core Concepts](#core-concepts)
27
- 5. [πŸ“‘ Event Handling](#event-handling)
28
- 6. [πŸ“© Sending Messages](#sending-messages)
29
- 7. [πŸ–Ό Sending Media](#sending-media)
30
- 8. [πŸ”§ Advanced Actions](#advanced-actions)
31
- 9. [πŸ› Issues & Feedback](#issues--feedback)
32
- 10. [❀️ Support](#support)
33
- 11. [πŸ“œ License](#license)
34
- 12. [πŸ™Œ Acknowledgements](#acknowledgements)
35
-
36
- ## ✨ Features
37
-
38
- - **Simplified API**: Minimal setup for rapid bot development.
39
- - **Multi-Device Support**: Full compatibility with WhatsApp’s multi-device feature via Baileys.
40
- - **Modular & Extensible**: Easily integrate middleware and custom storage solutions.
41
- - **QR Code Authentication**: Hassle-free login with terminal-based QR codes.
42
- - **TypeScript & ESM**: Full type safety and modern JavaScript support.
43
- - **Database Integration**: Supports SQLite, PostgreSQL, or MySQL for session persistence.
44
- - **Rate Limiting**: Built-in spam detection to prevent abuse.
45
- - **Webhooks Support**: Handle external events with a dynamically provided URL during runtime.
13
+ </div>
46
14
 
47
- ## πŸ“¦ Installation
15
+ **Zaileys** is a lightweight, user-friendly wrapper around the [Baileys](https://github.com/WhiskeySockets/Baileys) library, designed to simplify building WhatsApp bots and integrations with TypeScript or ESM JavaScript. It offers a streamlined API, robust multi-device support, and seamless database integration for session management.
48
16
 
49
- Install Zaileys using your preferred package manager:
17
+ > [!TIP]
18
+ > Stay updated and get support by joining our [WhatsApp Channel](https://whatsapp.com/channel/0029VazENbmInlqHIWzgn33h).
19
+
20
+ > [!IMPORTANT]
21
+ > There is no assurance that you won’t get blocked when using this approach. WhatsApp does not permit bots or unofficial clients, so use it at your own risk.
22
+
23
+ ### πŸ’  Table of Contents
24
+
25
+ - [Features](#-features)
26
+ - [Installation](#-installation)
27
+ - [Example Projects](#-example-projects)
28
+ - [Connecting Methods](#-connecting-methods)
29
+ - [QR Code](#qr-code)
30
+ - [Pairing Code](#pairing-code)
31
+ - [Quick Start](#-quick-start)
32
+ - [Core Concepts](#-core-concepts)
33
+ - [Citation](#citation)
34
+ - [Limiter](#limiter)
35
+ - [Fake Reply](#fake-reply)
36
+ - [Event Handling](#-event-handling)
37
+ - [Relay Handling](#-relay-handling)
38
+ - [General](#general)
39
+ - [Text Message](#text-message)
40
+ - [Reply Message](#reply-message)
41
+ - [Forward Message](#forward-message)
42
+ - [Edit Message](#edit-message)
43
+ - [Delete Message](#delete-message)
44
+ - [Reaction Message](#reaction-message)
45
+ - [Presence](#presence)
46
+ - [Reject Call](#reject-call)
47
+ - [Media](#media)
48
+ - [Document Message](#document-message)
49
+ - [Image Message](#image-message)
50
+ - [Sticker Message](#sticker-message)
51
+ - [Video Message](#video-message)
52
+ - [Audio Message](#audio-message)
53
+ - [Voice Message](#voice-message)
54
+ - [View Once Message](#view-once-message)
55
+ - [Note Message](#note-message)
56
+ - [Gif Message](#gif-message)
57
+ - [Location Message](#location-message)
58
+ - [Contacts Message](#contacts-message)
59
+ - [Polling Message](#polling-message)
60
+ - [Button Message](#button-message)
61
+ - [Group Control](#group-control)
62
+ - [Group Create](#group-create)
63
+ - [Group Action](#group-action)
64
+ - [Group Invite](#group-invite)
65
+ - [Group Update](#group-update)
66
+ - [Group Settings](#group-settings)
67
+ - [Group Leave](#group-leave)
68
+ - [Group Links](#group-links)
69
+ - [Group Invite](#group-invite)
70
+ - [Group Metadata](#group-metadata)
71
+ - [Group Requests](#group-requests)
72
+ - [Privacy Control](#privacy-control)
73
+ - [Privacy Update](#privacy-update)
74
+ - [Privacy Fetch](#privacy-fetch)
75
+ - [Profile Control](#profile-control)
76
+ - [Profile Bio](#profile-bio)
77
+ - [Profile Avatar](#profile-avatar)
78
+ - [Profile Business](#profile-business)
79
+ - [Profile Update](#profile-update)
80
+ - [Profile Check](#profile-check)
81
+ - [Issues & Feedback](#-issues---feedback)
82
+
83
+ ### πŸ’  Features
84
+
85
+ - 🎯 **Simplified API**: Minimal boilerplate get up and running in minutes.
86
+ - πŸ”’ **Secure Multi-Device**: Full multi-device support via Baileys.
87
+ - βš™οΈ **Modular & Extensible**: Plug-and-play middleware, transports, and storage layers.
88
+ - πŸ“Ÿ **Multi Auth (QR and Pairing Code)**: Connect to whatsapp with QR code or Pairing Code.
89
+ - πŸ› οΈ **TypeScript First**: Full type definitions and zero-config TS support.
90
+ - ~~πŸ“ˆ **Built-in Logging**: Integrated with Pino for structured logs.~~
91
+
92
+ ### πŸ’  Installation
93
+
94
+ > [!WARNING]
95
+ > Ensure you are running [Node.js](https://nodejs.org/) **>= 20** as specified in `package.json`.
96
+
97
+ Install with your preferred package manager:
50
98
 
51
99
  ```bash
52
100
  npm install zaileys
@@ -54,394 +102,617 @@ npm install zaileys
54
102
  yarn add zaileys
55
103
  # or
56
104
  pnpm add zaileys
105
+ # or
106
+ bun add zaileys
107
+ deno add npm:zaileys
57
108
  ```
58
109
 
59
- **Requirements**:
110
+ Then import your code using:
60
111
 
61
- - **Node.js**: Version 18 or higher.
62
- - **Module System**: ESM or TypeScript only (no CommonJS).
63
- - **Authentication**: QR code only (pairing code not supported).
64
- - **Unsupported Runtimes**: Deno and Bun (due to `better-sqlite3` incompatibility).
112
+ ```js
113
+ import { Client } from "zaileys";
114
+ // or
115
+ const { Client } = require("zaileys");
116
+ ```
65
117
 
66
- ## πŸš€ Quick Start
118
+ ### πŸ’  Example Projects
67
119
 
68
- Explore the `/examples` folder for practical use cases:
120
+ Explore the `examples` for practical use cases:
69
121
 
70
122
  - [Simple Setup](https://github.com/zeative/zaileys/blob/main/examples/simple.ts): A minimal setup for quick prototyping.
71
123
  - [Citation Example](https://github.com/zeative/zaileys/blob/main/examples/citation.ts): Demonstrates custom metadata with the citation mechanism.
72
124
  - [Rate Limiting Example](https://github.com/zeative/zaileys/blob/main/examples/limiter.ts): Shows how to implement spam detection.
73
125
  - [AI Integration with Groq](https://github.com/zeative/zaileys/blob/main/examples/llms.ts): Integrates AI capabilities using Groq.
74
- - [Webhooks Integration](https://github.com/zeative/zaileys/blob/main/examples/webhooks.ts): Handles webhook-based interactions.
75
126
  - [Voice Note with AI](https://github.com/zeative/zaileys/blob/main/examples/speech.ts): Interacts with AI using voice notes.
76
127
 
77
- ### Basic Example
128
+ ### πŸ’  Connecting Methods
78
129
 
79
- ```ts
80
- import { Client } from "zaileys";
130
+ > [!TIP]
131
+ > You can connect to WhatsApp using either a QR code or a pairing code.
81
132
 
82
- // default configuration
133
+ ### `QR Code`
134
+
135
+ ```js
83
136
  const wa = new Client({
84
- prefix: "/",
85
- ignoreMe: true,
86
- showLogs: true,
87
- autoRead: true,
88
- autoOnline: true,
89
- autoPresence: true,
90
- autoRejectCall: true,
91
- loadLLMSchemas: false,
92
- database: {
93
- type: "sqlite",
94
- connection: { url: "./session/zaileys.db" },
95
- },
137
+ authType: "qr",
96
138
  });
139
+ ```
97
140
 
98
- wa.on("messages", async (ctx) => {
99
- if (ctx.text === "test") {
100
- await wa.text("Hello!", { roomId: ctx.roomId });
101
- }
141
+ ### `Pairing Code`
142
+
143
+ ```js
144
+ const wa = new Client({
145
+ authType: "pairing",
146
+ phoneNumber: 628123456789,
102
147
  });
103
148
  ```
104
149
 
105
- ### Minimal Example
150
+ ### πŸ’  Quick Start
106
151
 
107
- ```ts
108
- import { Client } from "zaileys";
152
+ here is minimal example of how to run:
109
153
 
154
+ ```js
110
155
  const wa = new Client({ authType: "qr" });
111
156
 
112
157
  wa.on("messages", (ctx) => {
113
- wa.text("Hello", { roomId: ctx.roomId });
158
+ if (ctx.text == "ping") {
159
+ wa.text("pong");
160
+ }
114
161
  });
115
162
  ```
116
163
 
117
- ## πŸ›  Core Concepts
118
-
119
- ### Sessions & Authentication
120
-
121
- Zaileys uses QR code authentication and stores sessions in a database to avoid repeated QR scans.
122
-
123
- ```ts
124
- import { Client } from "zaileys";
125
-
126
- const wa = new Client({
127
- database: {
128
- type: "sqlite",
129
- connection: { url: "./session/zaileys.db" },
130
- },
131
- });
132
- ```
164
+ ### πŸ’  Core Concepts
133
165
 
134
- ### Citation Mechanism
166
+ ### `Citation`
135
167
 
136
- Define custom metadata providers for dynamic boolean flags in `ctx.citation`. See [citation.ts](https://github.com/zeative/zaileys/blob/main/examples/citation.ts).
168
+ Define custom metadata providers for dynamic boolean flags in `ctx.citation`. See `citation.ts`.
137
169
 
138
- ```ts
170
+ ```js
139
171
  const wa = new Client({
172
+ ...,
140
173
  citation: {
141
- admins: async () => [628123456789],
142
- vips: () => [628123456789],
143
- },
144
- });
174
+ admins: [628123456789]
175
+ }
176
+ })
145
177
 
146
178
  wa.on("messages", (ctx) => {
179
+ // from 'admins' to 'isAdmins'
180
+ // from 'test' to 'isTest'
147
181
  if (ctx.citation?.isAdmins) {
148
- wa.text("Admin access granted", { roomId: ctx.roomId });
182
+ wa.text("Admin access granted")
149
183
  }
150
- });
184
+ })
151
185
  ```
152
186
 
153
- ### Rate Limiting
187
+ ### `Limiter`
154
188
 
155
- Detect and prevent spam with the built-in limiter. See [limiter.ts](https://github.com/zeative/zaileys/blob/main/examples/limiter.ts).
189
+ Detect and prevent spam with the built-in limiter. See limiter.ts.
156
190
 
157
- ```ts
191
+ ```js
158
192
  const wa = new Client({
159
- authType: "qr",
160
-
161
- // max 10 messages on 10 seconds
193
+ ...,
194
+ // max 5 messages on 10 seconds
162
195
  limiter: {
163
196
  durationMs: 10000,
164
- maxMessages: 5,
165
- },
166
- });
197
+ maxMessages: 5
198
+ }
199
+ })
167
200
 
168
201
  wa.on("messages", (ctx) => {
169
202
  if (ctx.isSpam) {
170
- wa.text("You're spamming!!", { roomId: ctx.roomId });
171
- return;
203
+ wa.text("You're spamming!!");
172
204
  }
173
-
174
- wa.text("Hello!", { roomId: ctx.roomId });
175
- });
205
+ })
176
206
  ```
177
207
 
178
- ### Webhooks
208
+ ### `Fake Reply`
179
209
 
180
- Configure webhooks to handle external events. The URL is dynamically provided in the CLI upon running the app. See [webhooks.ts](https://github.com/zeative/zaileys/blob/main/examples/webhooks.ts).
210
+ Make it look like the number verified by manipulation.
181
211
 
182
- ```ts
212
+ ```js
183
213
  const wa = new Client({
184
- authType: "qr",
185
- webhooks: {
186
- url: "https://your-webhook-url.com",
187
- },
188
- });
214
+ ...,
215
+ fakeReply: {
216
+ provider: "whatsapp", // meta | chatgpt | copilot | instagram | tiktok
217
+ }
218
+ })
189
219
 
190
- wa.on("webhooks", (ctx) => {
191
- console.log(ctx.data.query); // Query params
192
- console.log(ctx.data.json); // JSON body
193
- console.log(ctx.data.form); // Form data
194
- console.log(ctx.data.raw); // Raw body
195
- });
220
+ wa.on("messages", (ctx) => {
221
+ if (ctx.text == "test") {
222
+ wa.reply("Test reply...");
223
+ }
224
+ })
196
225
  ```
197
226
 
198
- **Webhook Access**: Displayed in CLI on startup (e.g., `http://xxx.xxx.x.xxx:4135/webhooks`, Port: 4135, Methods: GET, POST).
227
+ ### πŸ’  Event Handling
199
228
 
200
- ## πŸ“‘ Event Handling
229
+ Types of events handled.
201
230
 
202
- ### Connection Events
231
+ ```js
232
+ /* Monitor connection status */
233
+ wa.on("connection", (ctx) => {});
203
234
 
204
- Monitor connection status changes.
235
+ /* Handle incoming messages */
236
+ wa.on("messages", (ctx) => {});
205
237
 
206
- ```ts
207
- wa.on("connection", (ctx) => {
208
- console.log(`Connection: ${ctx.status}`);
209
- });
238
+ /* Handle incoming calls */
239
+ wa.on("calls", (ctx) => {});
210
240
  ```
211
241
 
212
- ### Message Events
242
+ ### πŸ’  Relay Handling
213
243
 
214
- ```ts
215
- wa.on("messages", (ctx) => {
216
- console.log(ctx);
217
- });
244
+ ### `General`
245
+
246
+ #### *Text Message*
247
+
248
+ ```js
249
+ wa.text("Hello World!")
250
+ // or
251
+ wa.text({ text: "Hello World!" })
252
+
253
+ /* custom roomId */
254
+ wa.text({ text: "Hello World!", roomId: "12345@xxx" })
255
+ ```
256
+
257
+ auto mentions user/group (works for both):
258
+
259
+ ```js
260
+ wa.text("Hello @628123456789 @0")
261
+ ```
262
+
263
+ external ads preview (works for both):
264
+
265
+ ```js
266
+ wa.text({
267
+ text: "Test ads text",
268
+ externalAdReply: {
269
+ title: "Test ads title",
270
+ body: "Test ads body",
271
+ thumbnailUrl: "https://github.com/zeative.png",
272
+ mediaUrl: "https://zpi.my.id",
273
+ }
274
+ })
275
+ ```
276
+
277
+ #### *Reply Message*
278
+
279
+ ```js
280
+ wa.reply("Test reply message...")
281
+ ```
282
+
283
+ #### *Forward Message*
284
+
285
+ ```js
286
+ wa.forward("Test forward message...")
287
+ ```
288
+
289
+ #### *Edit Message*
290
+
291
+ ```js
292
+ const msg = await wa.text("Test edit message...")
293
+ await wa.edit({ text: "Edit success!", message: msg.message })
218
294
  ```
219
295
 
220
- Schemas output of `ctx` type:
221
-
222
- ```json
223
- {
224
- "chatId": "string",
225
- "channelId": "string",
226
- "uniqueId": "string",
227
- "receiverId": "string",
228
- "receiverName": "string",
229
- "roomId": "string",
230
- "roomName": "string",
231
- "senderId": "string",
232
- "senderName": "string",
233
- "senderDevice": "string",
234
- "chatType": "string",
235
- "timestamp": "number",
236
- "mentions": "array",
237
- "text": "string",
238
- "links": "array",
239
- "isPrefix": "boolean",
240
- "isSpam": "boolean",
241
- "isFromMe": "boolean",
242
- "isTagMe": "boolean",
243
- "isGroup": "boolean",
244
- "isStory": "boolean",
245
- "isViewOnce": "boolean",
246
- "isEdited": "boolean",
247
- "isDeleted": "boolean",
248
- "isPinned": "boolean",
249
- "isUnPinned": "boolean",
250
- "isChannel": "boolean",
251
- "isBroadcast": "boolean",
252
- "isEphemeral": "boolean",
253
- "isForwarded": "boolean",
254
- "citation": "object",
255
- "media": {
256
- ...
257
- "buffer": "function",
258
- "stream": "function"
259
- },
260
- "replied": "object (same schema as ctx)",
261
- "message": "function"
262
- }
263
- ```
264
-
265
- ### Call Events
266
-
267
- Handle incoming calls.
268
-
269
- ```ts
296
+ #### *Delete Message*
297
+
298
+ ```js
299
+ const msg = await wa.text("Test delete message...")
300
+ await wa.delete({ message: msg.message })
301
+ ```
302
+
303
+ #### *Reaction Message*
304
+
305
+ ```js
306
+ wa.reaction("🎯")
307
+ // or
308
+ wa.reaction({ emoticon: "🎯" });
309
+ ```
310
+
311
+ #### *Presence*
312
+
313
+ ```js
314
+ wa.presence("typing") // online | offline | recording | paused
315
+ ```
316
+
317
+ #### *Reject Call*
318
+
319
+ ```js
270
320
  wa.on("calls", (ctx) => {
271
- console.log(ctx);
272
- });
321
+ wa.reject(ctx);
322
+ // or
323
+ wa.reject({ callId: ctx.callId, callerId: ctx.callerId });
324
+ })
273
325
  ```
274
326
 
275
- ### Webhook Events
327
+ ### `Media`
276
328
 
277
- Handle external webhook requests.
329
+ #### *Document Message*
278
330
 
279
- ```ts
280
- wa.on("webhooks", (ctx) => {
281
- console.log(ctx.data.query); // Query params
282
- console.log(ctx.data.json); // JSON body
283
- console.log(ctx.data.form); // Form data
284
- console.log(ctx.data.raw); // Raw body
285
- });
331
+ ```js
332
+ wa.document("text", {
333
+ document: "https://github.com/zeative.png",
334
+ mimetype: "image/png",
335
+ fileName: "zaadevofc logo.png",
336
+ text: "Here your logo",
337
+ })
338
+
339
+ // others method: text | reply | forward
340
+ // example as reply
341
+ wa.document("reply" { ... })
286
342
  ```
287
343
 
288
- **Webhook Access**: Displayed in CLI on startup (e.g., `http://xxx.xxx.x.xxx:4135/webhooks`, Port: 4135, Methods: GET, POST).
344
+ #### *Image Message*
289
345
 
290
- ## πŸ“© Sending Messages
346
+ ```js
347
+ wa.image("text", {
348
+ image: "https://github.com/zeative.png",
349
+ text: "Here your logo",
350
+ })
351
+ ```
291
352
 
292
- ### Basic Text Messages
353
+ #### *Sticker Message*
293
354
 
294
- Send simple or advanced text messages with options like replies or forwarding.
355
+ ```js
356
+ wa.sticker("text", {
357
+ sticker: "https://example.com/file.webp"
358
+ })
359
+ ```
295
360
 
296
- ```ts
297
- const roomId = ctx.roomId;
298
- const message = ctx.message;
361
+ #### *Video Message*
299
362
 
300
- /* sending text */
301
- wa.text("Hello", { roomId });
363
+ ```js
364
+ wa.video("text", {
365
+ video: "https://example.com/file.mp4",
366
+ text: "Here your logo",
367
+ })
368
+ ```
302
369
 
303
- /* sending reply */
304
- wa.text("Reply", { roomId, quoted: message });
370
+ #### *Audio Message*
305
371
 
306
- /* sending forwarded */
307
- wa.text("Forwarded", { roomId, asForwarded: true });
372
+ ```js
373
+ wa.audio("text", {
374
+ audio: "https://example.com/file.mp3",
375
+ text: "Here your logo",
376
+ })
377
+ ```
378
+
379
+ #### *Voice Message*
380
+
381
+ ```js
382
+ wa.voice("text", {
383
+ audio: "https://example.com/file.ogg"
384
+ })
385
+ ```
308
386
 
309
- /* fake verified (just work on reply message only!) */
310
- wa.text("Verified reply", { roomId, quoted: message, verifiedReply: "whatsapp" });
387
+ #### *View Once Message*
388
+
389
+ ```js
390
+ wa.image("text", {
391
+ image: "https://github.com/zeative.png",
392
+ text: "Here your logo",
393
+ viewOnce: true
394
+ })
395
+
396
+ wa.video("text", {
397
+ ...,
398
+ viewOnce: true
399
+ })
400
+
401
+ wa.voice("text", {
402
+ ...,
403
+ viewOnce: true
404
+ })
405
+ ```
311
406
 
312
- /* mark as ai (just work on private message only!) */
313
- wa.text("Mark AI Message!", { roomId, asAI: true });
407
+ #### *Note Message*
314
408
 
315
- /* sending view once */
316
- wa.text({ image: "https://example.com/image.png", text: "View once" }, { roomId, asViewOnce: true });
409
+ ```js
410
+ wa.note("text", {
411
+ video: "https://example.com/file.mp4"
412
+ })
317
413
  ```
318
414
 
319
- ### Message Reactions, Edits, and Deletion
415
+ #### *Gif Message*
320
416
 
321
- Add reactions, edit, or delete messages.
417
+ ```js
418
+ wa.gif("text", {
419
+ video: "https://example.com/file.gif"
420
+ })
421
+ ```
322
422
 
323
- ```ts
324
- /* sending reaction */
325
- wa.reaction("πŸ‘", { message });
423
+ #### *Location Message*
326
424
 
327
- /* sending edit */
328
- const original = await wa.text("Will edit", { roomId });
329
- wa.edit("Edited", { message: original?.message });
425
+ ```js
426
+ wa.location('text', {
427
+ latitude: 1115,
428
+ longitude: -2225,
429
+ title: "Test location title",
430
+ footer: "Test location footer",
431
+ })
432
+ ```
330
433
 
331
- /* sending delete */
332
- const original = await wa.text("Will delete", { roomId });
333
- wa.delete("Deleted", { message: original?.message });
434
+ #### *Contacts Message*
435
+
436
+ ```js
437
+ wa.contacts('text', {
438
+ title: "Test contacts title",
439
+ contacts: [
440
+ {
441
+ fullname: "zaadevofc",
442
+ nickname: "kejaa",
443
+ phoneNumber: 628123456789,
444
+ website: "https://github.com/zaadevofc",
445
+ },
446
+ ],
447
+ })
334
448
  ```
335
449
 
336
- ### Polls
450
+ #### *Polling Message*
451
+
452
+ ```js
453
+ wa.poll('text', {
454
+ action: "create",
455
+ name: "Test poll",
456
+ answers: [
457
+ "Option 1",
458
+ "Option 2",
459
+ ],
460
+ })
461
+ ```
337
462
 
338
- Create interactive polls.
463
+ #### *Button Message*
464
+
465
+ simple button schema:
466
+
467
+ ```js
468
+ wa.button("text", {
469
+ type: "simple",
470
+ text: "Test button",
471
+ footer: "Test button footer",
472
+ buttons: [
473
+ {
474
+ id: "1",
475
+ text: "Test button 1",
476
+ },
477
+ {
478
+ id: "2",
479
+ text: "Test button 2",
480
+ }
481
+ ]D
482
+ })
483
+ ```
339
484
 
340
- ```ts
341
- /* sending polling */
342
- wa.poll({ name: "Do you love me?", answers: ["Yes", "Maybe", "No"] }, { roomId });
485
+ interactive button schema:
486
+
487
+ ```js
488
+ wa.button("text", {
489
+ type: "interactive",
490
+ text: "Test button",
491
+ footer: "Test button footer",
492
+ buttons: [
493
+ {
494
+ id: "1",
495
+ type: "quick_reply",
496
+ text: "Reply button",
497
+ },
498
+ {
499
+ id: "2",
500
+ type: "cta_copy",
501
+ text: "Copy button",
502
+ copy: "this is form copy",
503
+ },
504
+ {
505
+ id: "3",
506
+ type: "cta_call",
507
+ text: "Test Call",
508
+ phoneNumber: "628123456789",
509
+ },
510
+ {
511
+ id: "4",
512
+ type: "cta_url",
513
+ text: "Visit Url",
514
+ url: "https://github.com/zeative",
515
+ }
516
+ ]
517
+ })
343
518
  ```
344
519
 
345
- ### Contacts
520
+ ### `Group Control`
346
521
 
347
- Share contact information.
522
+ #### *Group Create*
348
523
 
349
- ```ts
350
- /* sending contact */
351
- wa.contact({ fullname: "Kejaa", whatsAppNumber: 628123456789 }, { roomId });
524
+ ```js
525
+ wa.group().create({
526
+ title: "Test New Group",
527
+ members: ["628123456789@s.whatsapp.net"],
528
+ })
352
529
  ```
353
530
 
354
- ### Location
531
+ #### *Group Action*
355
532
 
356
- Share geographic coordinates.
533
+ add new member to group:
357
534
 
358
- ```ts
359
- /* sending location */
360
- wa.location({ latitude: 24.121231, longitude: 55.1121221 }, { roomId });
535
+ ```js
536
+ wa.group().action({
537
+ action: "add",
538
+ roomId: "123456789@g.us",
539
+ members: ["628123456789@s.whatsapp.net"],
540
+ })
361
541
  ```
362
542
 
363
- ## πŸ–Ό Sending Media
543
+ checkout others action: `add` | `kick` | `promote` | `demote`
364
544
 
365
- ### Images and Stickers
545
+ #### *Group Update*
366
546
 
367
- Send images or stickers from URLs or local files.
547
+ update group subject:
368
548
 
369
- ```ts
370
- import fs from "fs";
549
+ ```js
550
+ wa.group().update({
551
+ action: "subject",
552
+ roomId: "123456789@g.us",
553
+ text: "Test New Group Title",
554
+ })
555
+ ```
556
+
557
+ checkout others action: `subject` | `description`
371
558
 
372
- /* sending by url */
373
- wa.text({ image: "https://github.com/zeative.png", text: "Image" }, { roomId });
559
+ #### *Group Settings*
374
560
 
375
- /* sending by file */
376
- wa.text({ image: fs.readFileSync("example/image.png"), text: "Image" }, { roomId });
561
+ setting group only admin can send message:
377
562
 
378
- /* sending sticker */
379
- wa.text({ sticker: "https://github.com/zeative.png" }, { roomId });
563
+ ```js
564
+ wa.group().settings({
565
+ action: "close",
566
+ roomId: "123456789@g.us"
567
+ })
380
568
  ```
381
569
 
382
- ### Videos and GIFs
570
+ checkout others action: `open` | `close` | `lock` | `unlock`
383
571
 
384
- Send videos or GIFs with optional captions.
572
+ #### *Group Leave*
385
573
 
386
- ```ts
387
- /* sending video */
388
- wa.text({ video: "https://example.com/video.mp4", text: "Video" }, { roomId });
574
+ leave group:
575
+
576
+ ```js
577
+ wa.group().leave({
578
+ roomId: "123456789@g.us"
579
+ })
580
+ ```
389
581
 
390
- /* sending video as circle */
391
- wa.text({ note: "https://example.com/video.mp4", text: "Video" }, { roomId });
582
+ #### *Group Invite*
392
583
 
393
- /* sending gif */
394
- wa.text({ gif: "https://example.com/video.mp4" }, { roomId });
584
+ join group chat by url:
585
+
586
+ ```js
587
+ wa.group().invite({
588
+ url: "https://chat.whatsapp.com/xxxxxx",
589
+ action: "join",
590
+ })
591
+ ```
592
+
593
+ checkout others action: `join` | `info`
594
+
595
+ #### *Group Metadata*
596
+
597
+ get group metadata:
598
+
599
+ ```js
600
+ wa.group().metadata({
601
+ roomId: "123456789@g.us",
602
+ })
603
+ ```
604
+
605
+ #### *Group Requests*
606
+
607
+ get request join list:
608
+
609
+ ```js
610
+ wa.group().requests.list({
611
+ roomId: "123456789@g.us",
612
+ })
395
613
  ```
396
614
 
397
- ### Audio and Voice Notes
615
+ approve request join:
398
616
 
399
- Send audio files or voice notes (use `.ogg` for compatibility).
617
+ ```js
618
+ wa.group().requests.approve({
619
+ roomId: "123456789@g.us",
620
+ members: ["628123456789@s.whatsapp.net"],
621
+ })
622
+ ```
400
623
 
401
- ```ts
402
- /* sending audio (recommended use .ogg format) */
403
- wa.text({ audio: "https://example.com/audio.ogg" }, { roomId });
624
+ reject request join:
404
625
 
405
- /* sending voice note (recommended use .ogg format) */
406
- wa.text({ voice: "https://example.com/audio.ogg" }, { roomId });
626
+ ```js
627
+ wa.group().requests.reject({
628
+ roomId: "123456789@g.us",
629
+ members: ["628123456789@s.whatsapp.net"],
630
+ })
407
631
  ```
408
632
 
409
- ## πŸ”§ Advanced Actions
633
+ ### `Privacy Control`
410
634
 
411
- ### Presence Updates
635
+ #### *Privacy Update*
412
636
 
413
- Update the bot’s presence status in a chat.
637
+ update profile picture privacy:
414
638
 
415
- ```ts
416
- wa.presence("typing", { roomId }); // Options: typing, recording, online, offline, paused
639
+ ```js
640
+ wa.privacy().update({
641
+ action: "avatar",
642
+ type: "all"
643
+ })
417
644
  ```
418
645
 
419
- ### Profile Retrieval
646
+ checkout others type: `avatar` | `groupsAdd` | `lastSeen` | `online` | `read` | `story`
647
+
648
+ #### *Privacy Fetch*
420
649
 
421
- Fetch user or group profiles.
650
+ get blocklists user:
422
651
 
423
- ```ts
424
- wa.profile("628123456789@s.whatsapp.net"); // User profile
425
- wa.profile("1209999@g.us"); // Group profile
652
+ ```js
653
+ wa.privacy().fetch.blocklists()
426
654
  ```
427
655
 
428
- ## πŸ› Issues & Feedback
656
+ get my settings:
429
657
 
430
- Encounter a bug or have a feature request? Submit it on our [GitHub Issues](https://github.com/zeative/zaileys/issues) page.
658
+ ```js
659
+ wa.privacy().fetch.settings()
660
+ ```
431
661
 
432
- ## ❀️ Support
662
+ ### `Profile Control`
433
663
 
434
- Show your support for Zaileys:
664
+ #### *Profile Bio*
435
665
 
436
- - [Buy me a coffee β˜•](https://saweria.co/zaadevofc)
437
- - ⭐ Star the repository on [GitHub](https://github.com/zeative/zaileys)
666
+ get user bio:
667
+
668
+ ```js
669
+ wa.profile().bio({ senderId: ctx.senderId })
670
+ ```
438
671
 
439
- ## πŸ“œ License
672
+ #### *Profile Avatar*
440
673
 
441
- Zaileys is licensed under the [MIT License](https://github.com/zeative/zaileys/blob/main/LICENSE).
674
+ get user/group avatar:
442
675
 
443
- ## πŸ™Œ Acknowledgements
676
+ ```js
677
+ wa.profile().avatar({ senderId: ctx.senderId })
678
+ // or group
679
+ wa.profile().avatar({ senderId: ctx.roomId })
680
+ ```
681
+
682
+ #### *Profile Business*
683
+
684
+ get user business:
685
+
686
+ ```js
687
+ wa.profile().business({ senderId: ctx.senderId })
688
+ ```
689
+
690
+ #### *Profile Update*
691
+
692
+ ```js
693
+ wa.profile().update({
694
+ type: 'avatar',
695
+ avatar: 'https://github.com/zeative.png',
696
+ })
697
+ ```
698
+
699
+ checkout others type: `avatar` | `bio` | `name`
700
+
701
+ #### *Profile Check*
702
+
703
+ ```js
704
+ wa.profile().check({ senderId: ctx.senderId })
705
+ ```
706
+
707
+ ### πŸ’  Issues & Feedback
708
+
709
+ **If you encounter any problems or have feature requests, please open an [issue](https://github.com/zeative/zaileys/issues)**
710
+
711
+ - [Buy me a coffee β˜•](https://saweria.co/zaadevofc)
712
+ - [Ko-Fi](https://ko-fi.com/zaadevofc)
713
+ - [Trakteer](https://trakteer.id/zaadevofc)
714
+ - ⭐ Star the repo on GitHub
444
715
 
445
- Powered by [Baileys](https://github.com/WhiskeySockets/Baileys) from Whiskey Sockets.
716
+ ### πŸ’  License
446
717
 
447
- Happy coding! πŸš€
718
+ Distributed under the **MIT License**. See [`LICENSE`](https://github.com/zeative/zaileys/blob/main/LICENSE) for details.