@rexxhayanasi/elaina-baileys 1.1.0 → 1.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.
package/README.MD CHANGED
@@ -1,13 +1,14 @@
1
- <div align="center">
2
- <h1>✨ @rexxhayanasi/elaina-baileys</h1>
3
- <p><em>Custom WhatsApp library built upon Baileys — enhanced, modernized, and elegant ✨</em></p>
1
+ <img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="100%">
4
2
 
5
- <img src="https://files.catbox.moe/dmz2fn.jpg" width="300" alt="Elaina Bail Banner" />
3
+ <div align="center">
4
+ <h1>🎄✨ @rexxhayanasi/elaina-baileys ✨🎄</h1>
5
+ <p><em>Custom WhatsApp library built upon Baileys — enhanced, modernized, and elegant.</em></p>
6
+ <p><strong>🎅 Merry Christmas & Happy New Year 2025 🎅</strong></p>
6
7
 
8
+ <img src="./media/IMG-20251223-WA1753.png" width="450" alt="Elaina Bail Banner" style="border-radius: 15px; border: 2px solid #ff0000;" />
9
+ <br><br>
7
10
 
8
-
9
- ---
10
- <p>
11
+ <p>
11
12
  <!-- NPM Version -->
12
13
  <a href="https://www.npmjs.com/package/@rexxhayanasi/elaina-baileys">
13
14
  <img src="https://img.shields.io/npm/v/@rexxhayanasi/elaina-baileys?color=blueviolet&label=version&logo=npm" alt="npm version" />
@@ -66,243 +67,274 @@
66
67
  <img src="https://img.shields.io/badge/Status-Baileys-blue?style=for-the-badge&logo=readthedocs&logoColor=white" alt="Status Baileys" />
67
68
  </a>
68
69
  </p>
70
+ </div>
69
71
 
70
- ---
72
+ <div align="center">
73
+ <img src="https://user-images.githubusercontent.com/74038190/212257468-1e9a91f1-b636-4676-a213-39d67b2d5d67.gif" width="100%">
74
+ </div>
71
75
 
72
76
  ## 📌 Overview
77
+ > ❄️ `elaina-baileys` is a refined version of the Baileys library with cleaner API usage, exclusive features like album messaging, newsletter controls, and full-size profile uploads — tailored for modern WhatsApp automation needs.
73
78
 
74
- > `elaina-baileys` is a refined version of the Baileys library with cleaner API usage, exclusive features like album messaging, newsletter controls, and full-size profile uploads — tailored for modern WhatsApp automation needs.
79
+ > **Christmas Update** 🎁
80
+ > All update information is now redirected to the WhatsApp channel check at the bottom of the "homepage"
75
81
 
76
- > `Update`
77
- + All update information is now redirected to the WhatsApp channel
78
- [!]<a href="https://whatsapp.com/channel/0029Vb70uHbD8SE2w5Q9M107">
79
- <img src="https://img.shields.io/badge/Join-WhatsApp%20Channel-25D366?logo=whatsapp&logoColor=white" alt="WhatsApp Channel" />
80
- </a>
82
+ ---
81
83
 
82
84
  ## 📦 Installation
83
85
 
84
- ### Via `package.json` Fork Baileys (NPM)
85
- @whiskeysockets/baileys
86
+ ### Via `package.json`
87
+
88
+ Fork Baileys (NPM) **@whiskeysockets/baileys** / **@adiwajshing/baileys**
89
+
86
90
  ```json
91
+ @whiskeysockets/baileys
87
92
  "dependencies": {
88
- "@whiskeysockets/baileys": "npm:@rexxhayanasi/elaina-baileys"
93
+ "@whiskeysockets/baileys": "npm:@rexxhayanasi/elaina-baileys"
89
94
  }
90
95
  ```
91
- @adiwajsing/baileys
92
96
  ```json
97
+ @adiwajsing/baileys
93
98
  "dependencies": {
94
- "@adiwajshing/baileys": "npm:@rexxhayanasi/elaina-baileys"
99
+ "@adiwajshing/baileys": "npm:@rexxhayanasi/elaina-baileys"
95
100
  }
96
101
  ```
97
102
 
98
- Or via terminal
103
+ Or via terminal non fork
99
104
  ```bash
100
105
  npm install elaina-bail@npm:@rexxhayanasi/elaina-baileys
101
106
  ```
102
107
 
103
- Importing (**for those who don't fork another repository**)
108
+ Importing (for those who don't fork another repository)
109
+ ESM & CJS
104
110
 
105
- ESM
111
+ > ESM
106
112
  ```bash
107
- import makeWASocket from '@rexxhayanasi/elaina-baileys'
113
+ import makeWASocket from '@rexxhayanasi/elaina-baileys
108
114
  ```
109
115
 
110
- CJS
116
+ > CJS
111
117
  ```bash
112
118
  const { default: makeWASocket } = require('@rexxhayanasi/elaina-baileys')
113
119
  ```
114
-
115
-
116
120
  ---
117
-
118
- ## 🌟 Key Features
119
-
120
- | Category | Description |
121
- |------------------|-----------------------------------------------------------------------------|
122
- | 📢 Channels | Seamlessly send messages to WhatsApp Channels. |
123
- | 🖱️ Buttons | Create interactive messages with button options and quick replies. |
124
- | 🖼️ Albums | Send grouped images or videos as an album (carousel-like format). |
125
- | 👤 LID Grouping | Handle group operations using the latest @lid addressing style. |
126
- | 🤖 AI Message Style | Add a stylized “AI” icon to messages. |
127
- | 📷 HD Profile Pics | Upload full-size profile pictures without cropping. |
128
- | 🔐 Pairing Code | Generate custom alphanumeric pairing codes. |
129
- | 🛠️ Dev Experience | Reduced noise from logs with optimized libsignal printouts. |
130
-
121
+ 🌟 Key Features
122
+ | Category | Description |
123
+ |---|---|
124
+ |channels | Seamlessly send messages to WhatsApp Channels. |
125
+ | 🖱️ Buttons | Create interactive messages with button options and quick replies. |
126
+ | 🖼️ Albums | Send grouped images or videos as an album (carousel-like format). |
127
+ | 👤 LID Grouping | Handle group operations using the latest @lid addressing style. |
128
+ | 🤖 AI Message Style | Add a stylized “AI” icon to messages. |
129
+ | 📷 HD Profile Pics | Upload full-size profile pictures without cropping. |
130
+ | 🔐 Pairing Code | Generate custom alphanumeric pairing codes. |
131
+ | 🛠️ Dev Experience | Reduced noise from logs with optimized libsignal printouts. |
131
132
  ---
132
133
 
133
- ## 💡 Use Case Examples
134
+ ## 🚀 Features & Usage
135
+
136
+ ### 📬 Newsletter Control
137
+ Kelola WhatsApp Newsletter (Channel), mulai dari pembuatan hingga interaksi pesan.
134
138
 
135
139
  <details>
136
- <summary><strong>📬 Newsletter Control</strong></summary>
140
+ <summary><strong>Lihat Contoh</strong></summary>
137
141
 
138
- ```javascript
142
+ ```js
139
143
  // Create a newsletter
140
144
  await sock.newsletterCreate("Elaina Updates");
141
145
 
142
- // Change description
143
- await sock.newsletterUpdateDescription("elaina@newsletter", "Fresh updates weekly");
144
-
145
- // Send a reaction to a channel message
146
- await sock.newsletterReactMessage("elaina@newsletter", "175", "🔥");
146
+ // Update description
147
+ await sock.newsletterUpdateDescription(
148
+ "elaina@newsletter",
149
+ "Fresh updates weekly"
150
+ );
151
+
152
+ // React to a channel message
153
+ await sock.newsletterReactMessage(
154
+ "elaina@newsletter",
155
+ "175",
156
+ "🔥"
157
+ );
147
158
  ```
148
-
149
159
  </details>
150
160
 
161
+ ---
162
+
163
+ ### 📌 Interactive Messaging
164
+ Kirim pesan interaktif menggunakan tombol untuk meningkatkan interaksi pengguna.
165
+
151
166
  <details>
152
- <summary><strong>📌 Interactive Messaging</strong></summary>
167
+ <summary><strong>Lihat Contoh</strong></summary>
153
168
 
154
- ```javascript
169
+ ```js
155
170
  const buttons = [
156
- { buttonId: 'btn1', buttonText: { displayText: 'Click Me' }, type: 1 },
157
- { buttonId: 'btn2', buttonText: { displayText: 'Visit Site' }, type: 1 }
171
+ { buttonId: "btn1", buttonText: { displayText: "Click Me" }, type: 1 },
172
+ { buttonId: "btn2", buttonText: { displayText: "Visit Site" }, type: 1 }
158
173
  ];
159
174
 
160
- const msg = {
175
+ await sock.sendMessage(id, {
161
176
  text: "Choose one:",
162
177
  footer: "From Elaina with love 💜",
163
178
  buttons,
164
179
  headerType: 1
165
- };
166
-
167
- await sock.sendMessage(id, msg, { quoted: null });
180
+ });
168
181
  ```
169
182
 
170
183
  </details>
171
184
 
185
+ ---
186
+
187
+ ### 🖼️ Send Album
188
+ Kirim beberapa media (gambar atau video) dalam satu pesan album.
189
+
172
190
  <details>
173
- <summary><strong>🖼️ Send Album</strong></summary>
191
+ <summary><strong>Lihat Contoh</strong></summary>
174
192
 
175
- ```javascript
193
+ ```js
176
194
  const media = [
177
195
  { image: { url: "https://example.com/pic1.jpg" } },
178
196
  { video: { url: "https://example.com/clip.mp4" } }
179
197
  ];
180
198
 
181
- await sock.sendMessage(id, { album: media, caption: "Memories 💫" }, { quoted: null });
199
+ await sock.sendMessage(
200
+ id,
201
+ { album: media, caption: "Memories 💫" }
202
+ );
182
203
  ```
183
204
 
184
205
  </details>
185
206
 
207
+ ---
208
+
209
+ ### 🔐 Custom Pairing Code
210
+ Pairing perangkat WhatsApp menggunakan kode kustom.
211
+
186
212
  <details>
187
- <summary><strong>🔐 Pairing with Custom Code</strong></summary>
213
+ <summary><strong>Lihat Contoh</strong></summary>
214
+
215
+ ```js
216
+ const code = await sock.requestPairingCode("62xxxxxxxxxx","ELAINA01");
188
217
 
189
- ```javascript
190
- const code = await sock.requestPairingCode("62xxxxxxxxxx", "ELAINA01");
191
- console.log("Your Pairing Code:", code);
218
+ console.log("Pairing Code:", code);
192
219
  ```
193
220
 
194
221
  </details>
195
222
 
196
- <details>
197
- <summary><strong>📊 Poll Creation</strong></summary>
223
+ ---
198
224
 
199
- ```javascript
200
- const pollMessage = {
201
- name: "Favorite Color?",
202
- values: ["Red", "Blue", "Green"],
203
- selectableCount: 1
204
- };
225
+ ### 📊 Poll Creation
226
+ Buat polling untuk voting cepat di chat atau grup.
205
227
 
206
- await sock.sendMessage(id, { poll: pollMessage });
228
+ <details>
229
+ <summary><strong>Lihat Contoh</strong></summary>
230
+
231
+ ```js
232
+ await sock.sendMessage(id, {
233
+ poll: {
234
+ name: "Favorite Color?",
235
+ values: ["Red", "Blue", "Green"],
236
+ selectableCount: 1
237
+ }
238
+ });
207
239
  ```
208
240
 
209
241
  </details>
210
242
 
211
- <details>
212
- <summary><strong>📍 Location Sharing</strong></summary>
243
+ ---
213
244
 
214
- ```javascript
215
- const locationMessage = {
216
- degreesLatitude: 37.422,
217
- degreesLongitude: -122.084,
218
- name: "Googleplex",
219
- address: "1600 Amphitheatre Pkwy, Mountain View, CA 94043"
220
- };
245
+ ### 📍 Location Sharing
246
+ Bagikan lokasi lengkap dengan koordinat dan alamat.
221
247
 
222
- await sock.sendMessage(id, { location: locationMessage });
248
+ <details>
249
+ <summary><strong>Lihat Contoh</strong></summary>
250
+
251
+ ```js
252
+ await sock.sendMessage(id, {
253
+ location: {
254
+ degreesLatitude: 37.422,
255
+ degreesLongitude: -122.084,
256
+ name: "Googleplex",
257
+ address: "1600 Amphitheatre Pkwy, Mountain View"
258
+ }
259
+ });
223
260
  ```
224
261
 
225
262
  </details>
226
263
 
227
- <details>
228
- <summary><strong>👥 Group Management</strong></summary>
264
+ ---
265
+
266
+ ### 👥 Group Management
267
+ Kelola grup WhatsApp: membuat grup, menambah anggota, dan memperbarui deskripsi.
268
+
229
269
 
230
- ```javascript
231
- // Create group
232
- const group = await sock.groupCreate("My New Group", [number1, number2]);
270
+ <details>
271
+ <summary><strong>Lihat Contoh</strong></summary>
233
272
 
234
- // Add participants
235
- await sock.groupAdd(group.id, [number3, number4]);
273
+ ```js
274
+ const group = await sock.groupCreate(
275
+ "My New Group",
276
+ [number1, number2]
277
+ );
236
278
 
237
- // Change group description
238
- await sock.groupUpdateDescription(group.id, "This is our awesome group!");
279
+ await sock.groupAdd(group.id, [number3]);
280
+ await sock.groupUpdateDescription(group.id,"This is our awesome group!"
281
+ );
239
282
  ```
240
283
 
241
284
  </details>
242
285
 
243
286
  ---
244
287
 
245
- **Note:** Replace `id` with the actual recipient ID and `sock` with your WhatsApp socket connection variable.
288
+ ### 🐞 Menemukan Bug?
246
289
 
247
- ---
248
-
249
- ## 🐞 Found a Bug?
290
+ Jika Anda menemukan bug atau kendala saat menggunakan proyek ini, silakan lakukan salah satu opsi berikut:
250
291
 
251
- Please open an issue at [ *UNCOMING WEBSITE* ]
252
- Or contact the maintainer directly via WhatsApp:
292
+ - **Buka Issue** melalui website resmi (segera hadir)
293
+ - **Hubungi maintainer langsung** melalui WhatsApp
253
294
 
254
295
  <p align="center">
255
- <a href="https://wa.me/6285282530851" target="_blank">
256
- <img alt="WhatsApp" src="https://img.shields.io/badge/Chat%20on%20WhatsApp-25D366?style=for-the-badge&logo=whatsapp&logoColor=white">
296
+ <a href="https://wa.me/6285282530851" target="_blank" rel="noopener noreferrer">
297
+ <img
298
+ alt="Chat on WhatsApp"
299
+ src="https://img.shields.io/badge/Chat%20on%20WhatsApp-25D366?style=for-the-badge&logo=whatsapp&logoColor=white"
300
+ />
257
301
  </a>
258
302
  </p>
259
-
260
- ---
261
-
262
303
  <details>
263
- <summary>🙏 <strong>TQTO (Thanks To)</strong></summary>
264
-
265
- Terima kasih kepada pihak-pihak yang telah memberikan dukungan, inspirasi, dan kontribusi secara langsung maupun tidak langsung dalam pengembangan proyek ini:
266
-
267
- - **Allah SWT**
268
- For all His grace and ease.
269
-
270
- - **Parent**
271
- For your continued love, prayers, and support.
304
+ <summary>🙏 <strong>TQTO (Thanks To)</strong></summary>
272
305
 
273
- - **[Nstar-Y / Nstar-bail](https://github.com/Nstar-Y)**
274
- As an initial foundation and reference in the development of this system.
306
+ Terima kasih kepada semua pihak yang telah memberikan dukungan, inspirasi, serta kontribusi—baik secara langsung maupun tidak langsung—dalam pengembangan proyek ini:
275
307
 
276
- - **[RexxHayanasi](https://github.com/RexxHayanasi)** (Me)
277
- The main developer of this project.
308
+ - **Allah SWT** — atas segala rahmat, kemudahan, dan perlindungan-Nya.
309
+ - **Orang Tua** atas kasih sayang, doa, dan dukungan yang tiada henti.
310
+ - **Nstar-Y / Nstar-bail** — sebagai fondasi awal dan referensi dalam pengembangan sistem ini.
311
+ - **RexxHayanasi (Saya)** — pengembang utama proyek ini.
278
312
 
279
313
  </details>
280
314
 
281
315
  > [!CAUTION]
282
- > Built on top of the WhiskeySockets/Baileys project. All original core logic credits go to their team. elaina-bail extends it with thoughtful UX and DX improvements.
283
-
284
- ---
285
-
286
- ### 🙌 Contributors outside the Baileys code
287
-
316
+ > Built on top of the WhiskeySockets/Baileys project. All original core logic credits go to their team. elaina-baileys extends it with thoughtful UX and DX improvements.
317
+ > 🙌 Contributors outside the Baileys code
288
318
  Thanks to the following awesome contributors who help improve this project 💖
289
319
 
290
320
  <table>
291
- <tr>
292
- <td align="center">
293
- <a href="https://github.com/RexxHayanasi">
294
- <img src="https://avatars.githubusercontent.com/u/150516773?v=4" width="80px;" style="border-radius:50%;" alt="Matstoree"/>
295
- <br />
296
- <sub><b>RexxHayanasi [ developer project ]</b></sub>
297
- </a>
298
- </td>
321
+ <tr>
299
322
  <td align="center">
300
- <a href="https://github.com/kiuur">
301
- <img src="https://avatars.githubusercontent.com/u/182334162?v=4" width="80px;" style="border-radius:50%;" alt="Matstoree"/>
302
- <br />
303
- <sub><b>Kyuu [ kiuur ]</b></sub>
304
- </a>
305
- </td>
306
-
307
- </tr>
323
+ <a href="https://github.com/RexxHayanasi">
324
+ <img src="https://avatars.githubusercontent.com/u/150516773?v=4" width="80px;" style="border-radius:50%;" alt="Matstoree"/>
325
+ <br />
326
+ <sub><b>RexxHayanasi [ developer project ]</b></sub>
327
+ </a>
328
+ </td>
329
+
330
+ <td align="center">
331
+ <a href="https://github.com/kiuur">
332
+ <img src="https://avatars.githubusercontent.com/u/182334162?v=4" width="80px;" style="border-radius:50%;" alt="Matstoree"/>
333
+ <br />
334
+ <sub><b>Kyuu [ kiuur ]</b></sub>
335
+ </a>
336
+ </td>
337
+ </tr>
308
338
  </table>
339
+
340
+ <img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="100%" style="transform: rotate(180deg);">
@@ -32,4 +32,5 @@ __exportStar(require("./link-preview"), exports);
32
32
  __exportStar(require("./event-buffer"), exports);
33
33
  __exportStar(require("./process-message"), exports);
34
34
  __exportStar(require("./message-retry-manager"), exports);
35
- __exportStar(require("./browser-utils"), exports);
35
+ __exportStar(require("./browser-utils"), exports);
36
+ __exportStar(require("./resolveJid"), exports);
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.resolveJid = void 0;
5
+
6
+ const WABinary = require("../WABinary");
7
+
8
+ async function resolveJid(sock, m, target) {
9
+ if (target === void 0) target = null;
10
+
11
+ const input =
12
+ target ||
13
+ (m.mentionedJid && m.mentionedJid[0]) ||
14
+ m.participant ||
15
+ (m.key && (m.key.participant || m.key.remoteJid));
16
+
17
+ if (!input)
18
+ return null;
19
+
20
+ if (/@s\.whatsapp\.net$/.test(input))
21
+ return input;
22
+
23
+ const chat =
24
+ m.chat ||
25
+ (m.key && m.key.remoteJid);
26
+
27
+ if (!chat || !chat.endsWith("@g.us"))
28
+ return null;
29
+
30
+ const metadata = await sock.groupMetadata(chat);
31
+
32
+ const participant = metadata.participants.find(p =>
33
+ WABinary.areJidsSameUser(p.jid, input) ||
34
+ WABinary.areJidsSameUser(p.id, input) ||
35
+ (p.lid && p.lid === input)
36
+ );
37
+
38
+ return participant ? participant.jid : null;
39
+ }
40
+
41
+ exports.resolveJid = resolveJid;
package/lib/index.js CHANGED
@@ -3,12 +3,14 @@
3
3
  const chalk = require("chalk");
4
4
  const gradient = require("gradient-string");
5
5
 
6
- const title = "@rexxhayanasi/elaina-baileys| Default Paircode: ELAI-NAMD";
7
6
 
8
- console.log(gradient(["#7EC9FF", "#D3B7FF"])(title));
9
- console.log(gradient(["#7EC9FF", "#D3B7FF"])("════════════════════════════════════════════════════"));
10
- console.log(gradient(["#D3B7FF", "#A8C7FF"])("> Hubungi Tim @rexxhayanasi/elaina-baileys jika baileys terjadi error <"));
11
- console.log(gradient(["#7EC9FF", "#D3B7FF"])("════════════════════════════════════════════════════"));
7
+ const title = "🎄 @rexxhayanasi/elaina-baileys | 🎅 Christmas 2025 Edition 🎅 | Paircode: ELAI-NAMD";
8
+
9
+ console.log(gradient(["#FF0000", "#00FF00", "#FFFFFF"])("❄️ ═════════════════════════════════════════════════════════════════ ❄️"));
10
+ console.log(gradient(["#FF0000", "#FFFFFF", "#FF0000"])(title));
11
+ console.log(gradient(["#FFD700", "#FFFFFF"])("🎁 Semoga kode Anda bebas dari bug selama musim liburan ini! 🎁"));
12
+ console.log(gradient(["#00FF00", "#FFFFFF", "#00FF00"])("> Hubungi Tim @rexxhayanasi/elaina-baileys jika baileys terjadi error <"));
13
+ console.log(gradient(["#FF0000", "#00FF00", "#FFFFFF"])("❄️ ═════════════════════════════════════════════════════════════════ ❄️"));
12
14
 
13
15
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
16
  if (k2 === undefined) k2 = k;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rexxhayanasi/elaina-baileys",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Custom Baileys WhatsApp API",
5
5
  "keywords": [
6
6
  "baileys",
@@ -72,7 +72,7 @@
72
72
  "conventional-changelog-cli": "^2.2.2",
73
73
  "eslint": "^8.0.0",
74
74
  "jest": "^27.0.6",
75
- "jimp": "^1.6.0",
75
+ "jimp": "^0.22.10",
76
76
  "json": "^11.0.0",
77
77
  "link-preview-js": "^3.0.0",
78
78
  "open": "^8.4.2",