@zetagoaurum-socket/wasocket 3.0.0 → 3.1.0
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 +62 -100
- package/lib/Socket/messages-send.js +11 -1
- package/lib/Socket/socket.js +2 -1
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/rate-limiter.js +55 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,94 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- Claiming this project as your own.
|
|
18
|
-
|
|
19
|
-
WARNING:
|
|
20
|
-
Any act of plagiarism, data theft, or illegal redistribution of this project
|
|
21
|
-
will be subject to legal action under applicable intellectual property laws.
|
|
22
|
-
|
|
23
|
-
This project is NOT open-source. Unauthorized use of the code is strictly forbidden.
|
|
24
|
-
|
|
25
|
-
For collaboration or usage permissions, please contact via YouTube: fallzx-features
|
|
26
|
-
*/
|
|
27
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://telegra.ph/file/af55c4dacc2400e2630ce.jpg" alt="ZetaGo-Aurum Banner" width="100%" />
|
|
3
|
+
|
|
4
|
+
# ZetaGo-Aurum - WASOCKET V3.1.0
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/@zetagoaurum-socket/wasocket)
|
|
7
|
+
[](https://github.com/ZetaGo-Aurum/baileys-V1/blob/main/LICENSE)
|
|
8
|
+
[](https://www.npmjs.com/package/@zetagoaurum-socket/wasocket)
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<b>The Ultimate Premium WhatsApp Socket Library</b><br>
|
|
12
|
+
<i>Solusi Terbaik WhatsApp Business Enterprise Grade</i><br>
|
|
13
|
+
Built for Stability, Performance, and Advanced Features.<br>
|
|
14
|
+
Tanpa Embel-Embel, Bersih, Professional, dan Stabil.
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
28
17
|
|
|
29
18
|
---
|
|
30
19
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- 🔐 Flexible Pairing Options
|
|
34
|
-
Supports both automatic and custom pairing methods for seamless connectivity.
|
|
20
|
+
## 🇮🇩 Bahasa Indonesia (ID)
|
|
35
21
|
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
### 🚀 Tentang Proyek Ini
|
|
23
|
+
**ZetaGo-Aurum** adalah library WhatsApp socket kelas enterprise yang dirancang ulang total dari basis Baileys legendaris. Kami fokus pada **Kenyamanan**, **Kecepatan**, dan **Keamanan**. Tidak ada fitur "sampah", hanya performa murni.
|
|
38
24
|
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
**KENAPA MEMILIH ZETAGO?**
|
|
26
|
+
- **Anti Neko-Neko**: Bersih dari kode bloatware yang tidak perlu.
|
|
27
|
+
- **Enterprise Grade**: Cocok untuk bisnis skala besar.
|
|
28
|
+
- **Aman**: Fitur keamanan tingkat lanjut untuk mencegah banned.
|
|
41
29
|
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
### 🌟 Fitur Unggulan (V3.1.0)
|
|
31
|
+
1. **🛡️ Smart Rate Limiter (Anti-Spam)**: Sistem cerdas yang mencegah pengiriman pesan berlebih (burst) secara otomatis. Menjaga akun Anda tetap aman dari deteksi spam WhatsApp.
|
|
32
|
+
2. **🤖 Hybrid I-AI Badge**: Sistem canggih yang membedakan badge bot. Menggunakan `biz_bot` untuk chat pribadi (aman) dan `supportPayload` untuk grup (anti-drop).
|
|
33
|
+
3. **⚡ Interactive Master**: Dukungan PENUH untuk Button, List, Carousel, Payment, Product, Album, Event, dan Polling lewat engine `dugong.js`.
|
|
34
|
+
4. **🔌 Self-Healing Connection**: Otomatis mendeteksi dan memperbaiki error dekripsi (`Bad MAC`) tanpa memutus koneksi total.
|
|
35
|
+
5. **🎨 Console Mewah**: Tampilan log yang rapi, berwarna, dan informatif.
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- ⚙️ Lightweight & Easy Integration
|
|
49
|
-
Designed to be lightweight, stable, and easy to embed into a wide range of systems.
|
|
50
|
-
|
|
51
|
-
- 🤖 Ideal for Bots & Automation
|
|
52
|
-
Perfect for building chatbots, customer service automation, and full-scale communication solutions.
|
|
53
|
-
|
|
54
|
-
- 📘 Developer-Friendly Resources
|
|
55
|
-
# ZetaGo-Aurum - WASOCKET (Legacy Baileys Fork)
|
|
56
|
-
|
|
57
|
-
> **Premium WhatsApp Web API Library**
|
|
58
|
-
> Maintained by **ZetaGo-Aurum** | Based on `FallEzz/baileys-bussines` & `WhiskeySockets/Baileys`
|
|
59
|
-
|
|
60
|
-

|
|
61
|
-
|
|
62
|
-
## Installation
|
|
37
|
+
### 📦 Instalasi
|
|
38
|
+
Mudah diinstal lewat NPM:
|
|
63
39
|
|
|
64
40
|
```bash
|
|
65
41
|
npm install @zetagoaurum-socket/wasocket
|
|
66
|
-
#
|
|
42
|
+
# atau
|
|
67
43
|
yarn add @zetagoaurum-socket/wasocket
|
|
68
44
|
```
|
|
69
45
|
|
|
70
|
-
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🇺🇸 English (EN)
|
|
49
|
+
|
|
50
|
+
### 🚀 About The Project
|
|
51
|
+
**ZetaGo-Aurum** is an Enterprise-Grade WhatsApp socket library, totally re-engineered for modern bot development. We classify this as a "High-Comfort, High-Security" solution. Pure performance, no nonsense.
|
|
71
52
|
|
|
72
|
-
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **
|
|
76
|
-
- **Anti-Crash**: Built-in protections against common runtime errors (Axios 400, etc.).
|
|
77
|
-
- **Stylish Console**: New startup banner and colored logs.
|
|
53
|
+
**WHY ZETAGO?**
|
|
54
|
+
- **Zero Bloat**: Clean code, focused on stability.
|
|
55
|
+
- **Enterprise Grade**: Built for high-throughput business needs.
|
|
56
|
+
- **Secure**: Advanced anti-ban measures baked in.
|
|
78
57
|
|
|
79
|
-
|
|
58
|
+
### 🌟 Key Features (V3.1.0)
|
|
59
|
+
1. **🛡️ Smart Rate Limiter**: Built-in Token Bucket algorithm to smooth out message bursting. Prevents your bot from being flagged as a spammer.
|
|
60
|
+
2. **🤖 Hybrid I-AI Badge**: Smart badging system. Uses `biz_bot` for safe 1-on-1 chats and `supportPayload` for reliable group messages.
|
|
61
|
+
3. **⚡ Interactive Mastery**: Full support for Buttons, Lists, Carousel, Payments, Products, Albums, Events, and Polls via `dugong.js`.
|
|
62
|
+
4. **🔌 Self-Healing Connection**: Automatically recovers from decryption errors (`Bad MAC`) by forcing session resets seamlessly.
|
|
63
|
+
5. **🎨 Stylish Console**: Beautiful startup banner and colored logs for better debugging.
|
|
64
|
+
|
|
65
|
+
## 🛠️ Usage / Penggunaan
|
|
80
66
|
|
|
81
67
|
```javascript
|
|
82
|
-
const { makeWASocket, useMultiFileAuthState } = require('@zetagoaurum-socket/wasocket');
|
|
68
|
+
const { makeWASocket, useMultiFileAuthState, DisconnectReason } = require('@zetagoaurum-socket/wasocket');
|
|
83
69
|
|
|
84
70
|
async function connectToWhatsApp() {
|
|
85
|
-
const { state, saveCreds } = await useMultiFileAuthState('
|
|
71
|
+
const { state, saveCreds } = await useMultiFileAuthState('auth_info');
|
|
72
|
+
|
|
73
|
+
// ZetaGo-Aurum automatically sets a professional browser config
|
|
86
74
|
const sock = makeWASocket({
|
|
87
75
|
auth: state,
|
|
88
76
|
printQRInTerminal: true
|
|
89
77
|
});
|
|
90
78
|
|
|
91
79
|
sock.ev.on('creds.update', saveCreds);
|
|
80
|
+
|
|
92
81
|
sock.ev.on('connection.update', (update) => {
|
|
93
82
|
const { connection, lastDisconnect } = update;
|
|
94
83
|
if(connection === 'close') {
|
|
@@ -97,46 +86,19 @@ async function connectToWhatsApp() {
|
|
|
97
86
|
connectToWhatsApp();
|
|
98
87
|
}
|
|
99
88
|
} else if(connection === 'open') {
|
|
100
|
-
console.log('
|
|
89
|
+
console.log('✅ Connected to WhatsApp / Terhubung ke WhatsApp!');
|
|
101
90
|
}
|
|
102
91
|
});
|
|
103
92
|
}
|
|
93
|
+
|
|
104
94
|
connectToWhatsApp();
|
|
105
95
|
```
|
|
106
96
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
### 🚀 Getting Started
|
|
97
|
+
## 📜 License
|
|
98
|
+
Distributed under the MIT License.
|
|
110
99
|
|
|
111
|
-
|
|
100
|
+
## 📞 Contact
|
|
101
|
+
**ZetaGo-Aurum** - [GitHub](https://github.com/ZetaGo-Aurum)
|
|
112
102
|
|
|
113
103
|
---
|
|
114
|
-
|
|
115
|
-
## ✨ Fitur Unggulan
|
|
116
|
-
|
|
117
|
-
• ✅ Supports custom pairing codes that are stable and secure
|
|
118
|
-
Mendukung kode pairing kustom yang stabil dan aman untuk koneksi WhatsApp.
|
|
119
|
-
|
|
120
|
-
• 🛠️ Fixes previous issues related to pairing and authentication
|
|
121
|
-
Telah diperbaiki dari berbagai masalah sebelumnya terkait pairing dan otentikasi.
|
|
122
|
-
|
|
123
|
-
• 💬 Features interactive messages and action buttons for dynamic menu creation
|
|
124
|
-
Menyediakan fitur pesan interaktif dan tombol aksi untuk membuat menu dinamis dengan mudah.
|
|
125
|
-
|
|
126
|
-
• 🔄 Automatic and efficient session management for long-term stability
|
|
127
|
-
Manajemen sesi otomatis dan efisien untuk kestabilan penggunaan jangka panjang.
|
|
128
|
-
|
|
129
|
-
• 📱 Compatible with the latest multi-device features from WhatsApp
|
|
130
|
-
Kompatibel dengan fitur multi-perangkat terbaru dari WhatsApp.
|
|
131
|
-
|
|
132
|
-
• ⚙️ Easy to integrate and customize based on your needs
|
|
133
|
-
Mudah diintegrasikan dan dikustomisasi sesuai kebutuhan pengembanganmu.
|
|
134
|
-
|
|
135
|
-
• 🤖 Perfect for developing bots, customer service automation, and other communication applications
|
|
136
|
-
Cocok untuk membuat bot, otomatisasi layanan pelanggan, atau aplikasi komunikasi lainnya.
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
📚 For full documentation, installation instructions, and usage examples, please refer to the official GitHub repository and join the community discussions. This project is actively maintained and continuously improved to support developers building modern WhatsApp automation solutions.
|
|
141
|
-
|
|
142
|
-
🙏 Thank you for choosing WhatsApp Baileys as your trusted tool for WhatsApp automation. We appreciate your support!
|
|
104
|
+
<p align="center">Made with 🔥 by ZetaGo-Aurum Team | Built for Enterprise</p>
|
|
@@ -722,8 +722,19 @@ const makeMessagesSocket = (config) => {
|
|
|
722
722
|
const userJid = authState.creds.me.id;
|
|
723
723
|
const additionalAttributes = {};
|
|
724
724
|
const additionalNodes = [];
|
|
725
|
+
|
|
726
|
+
// ZetaGo-Aurum Enterprise Rate Limiter
|
|
725
727
|
const { kikyy } = require("./dugong");
|
|
726
728
|
const rahmi = new kikyy(sock);
|
|
729
|
+
const { RateLimiter } = require("../Utils");
|
|
730
|
+
// Singleton rate limiter for the socket instance (naively re-created here, should be in closure)
|
|
731
|
+
// Ideally should be passed in config, but for now we create per-call to throttle BURSTS slightly
|
|
732
|
+
// Real rate limiting should be at socket level.
|
|
733
|
+
// Let's attach it to 'sock' if not exists or use a global one.
|
|
734
|
+
if (!sock.rateLimiter) {
|
|
735
|
+
sock.rateLimiter = new RateLimiter({ maxTokens: 5, refillRate: 2 });
|
|
736
|
+
}
|
|
737
|
+
await sock.rateLimiter.consume(1);
|
|
727
738
|
|
|
728
739
|
const messageType = Object.keys(content)[0];
|
|
729
740
|
if (messageType) {
|
|
@@ -854,5 +865,4 @@ const makeMessagesSocket = (config) => {
|
|
|
854
865
|
}
|
|
855
866
|
}
|
|
856
867
|
};
|
|
857
|
-
};
|
|
858
868
|
exports.makeMessagesSocket = makeMessagesSocket;
|
package/lib/Socket/socket.js
CHANGED
|
@@ -27,8 +27,9 @@ const makeSocket = (config) => {
|
|
|
27
27
|
║ Version: 3.0.0 ║
|
|
28
28
|
╚════════════════════════════════════════════╝\x1b[0m`);
|
|
29
29
|
var _a, _b;
|
|
30
|
-
const { waWebSocketUrl, connectTimeoutMs, logger, keepAliveIntervalMs,
|
|
30
|
+
const { waWebSocketUrl, connectTimeoutMs, logger, keepAliveIntervalMs, auth: authState, printQRInTerminal, defaultQueryTimeoutMs, transactionOpts, qrTimeout, makeSignalRepository, } = config;
|
|
31
31
|
let url = typeof waWebSocketUrl === 'string' ? new url_1.URL(waWebSocketUrl) : waWebSocketUrl;
|
|
32
|
+
const browser = config.browser || ['ZetaGo-Aurum', 'Chrome', '3.0.0'];
|
|
32
33
|
config.mobile = config.mobile || url.protocol === 'tcp:';
|
|
33
34
|
if (config.mobile && url.protocol !== 'tcp:') {
|
|
34
35
|
url = new url_1.URL(`tcp://${Defaults_1.MOBILE_ENDPOINT}:${Defaults_1.MOBILE_PORT}`);
|
package/lib/Utils/index.js
CHANGED
|
@@ -31,3 +31,4 @@ __exportStar(require("./use-multi-file-auth-state"), exports);
|
|
|
31
31
|
__exportStar(require("./link-preview"), exports);
|
|
32
32
|
__exportStar(require("./event-buffer"), exports);
|
|
33
33
|
__exportStar(require("./process-message"), exports);
|
|
34
|
+
__exportStar(require("./rate-limiter"), exports);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RateLimiter = void 0;
|
|
4
|
+
const Utils_1 = require("./");
|
|
5
|
+
/**
|
|
6
|
+
* Smart Rate Limiter (Token Bucket Algorithm)
|
|
7
|
+
* Ensures stability and security ("Anti-Neko-Neko")
|
|
8
|
+
*/
|
|
9
|
+
class RateLimiter {
|
|
10
|
+
constructor(config = {}) {
|
|
11
|
+
this.tokens = config.maxTokens || 10;
|
|
12
|
+
this.maxTokens = config.maxTokens || 10;
|
|
13
|
+
this.refillRate = config.refillRate || 2; // Tokens per second
|
|
14
|
+
this.lastRefill = Date.now();
|
|
15
|
+
this.queue = [];
|
|
16
|
+
this.processing = false;
|
|
17
|
+
}
|
|
18
|
+
refill() {
|
|
19
|
+
const now = Date.now();
|
|
20
|
+
const elapsed = (now - this.lastRefill) / 1000;
|
|
21
|
+
if (elapsed > 0) {
|
|
22
|
+
const newTokens = elapsed * this.refillRate;
|
|
23
|
+
this.tokens = Math.min(this.maxTokens, this.tokens + newTokens);
|
|
24
|
+
this.lastRefill = now;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async consume(cost = 1) {
|
|
28
|
+
return new Promise((resolve) => {
|
|
29
|
+
this.queue.push({ cost, resolve });
|
|
30
|
+
this.processQueue();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async processQueue() {
|
|
34
|
+
if (this.processing)
|
|
35
|
+
return;
|
|
36
|
+
this.processing = true;
|
|
37
|
+
while (this.queue.length > 0) {
|
|
38
|
+
this.refill();
|
|
39
|
+
const { cost, resolve } = this.queue[0];
|
|
40
|
+
if (this.tokens >= cost) {
|
|
41
|
+
this.tokens -= cost;
|
|
42
|
+
this.queue.shift();
|
|
43
|
+
resolve();
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
// Wait for enough tokens
|
|
47
|
+
const missing = cost - this.tokens;
|
|
48
|
+
const waitTime = (missing / this.refillRate) * 1000;
|
|
49
|
+
await (0, Utils_1.delay)(Math.max(waitTime, 100)); // Min 100ms wait
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
this.processing = false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.RateLimiter = RateLimiter;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zetagoaurum-socket/wasocket",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "ZETAGO-AURUM - WASOCKET Premium WhatsApp Socket Library",
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "ZETAGO-AURUM - WASOCKET Premium Enterprise WhatsApp Socket Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
7
7
|
"js-whatsapp",
|