rixleys 1.0.1 → 1.0.2
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 +1 -0
- package/lib/Socket/index.js +14 -1
- package/package.json +1 -1
package/README.MD
CHANGED
|
@@ -50,6 +50,7 @@ const bot = new makeWASocket({
|
|
|
50
50
|
sessionName: "session-folder", // Folder sesi (default: "auth-session")
|
|
51
51
|
usePairingCode: true, // true = pairing code, false = QR code terminal
|
|
52
52
|
phoneNumber: "6281234567890", // Nomor WhatsApp (wajib jika usePairingCode = true)
|
|
53
|
+
liteMode: true, // Mode super ringan (hemat RAM & CPU, default: true)
|
|
53
54
|
autoReconnect: true, // Auto-reconnect cerdas jika koneksi terputus
|
|
54
55
|
maxReconnectAttempts: 10, // Batas maksimal percobaan reconnect
|
|
55
56
|
autoCleanSessionOnLogout: true // Otomatis hapus folder sesi jika logout/banned
|
package/lib/Socket/index.js
CHANGED
|
@@ -32,6 +32,9 @@ const rawMakeWASocket = (config) =>
|
|
|
32
32
|
class Client extends events.EventEmitter {
|
|
33
33
|
constructor(options = {}) {
|
|
34
34
|
super();
|
|
35
|
+
|
|
36
|
+
const isLite = options.liteMode !== false; // Default true (Hemat RAM)
|
|
37
|
+
|
|
35
38
|
this.options = {
|
|
36
39
|
sessionName: "auth-session",
|
|
37
40
|
usePairingCode: false,
|
|
@@ -41,7 +44,17 @@ class Client extends events.EventEmitter {
|
|
|
41
44
|
maxReconnectAttempts: 10,
|
|
42
45
|
autoCleanSessionOnLogout: true,
|
|
43
46
|
printQRInTerminal: true,
|
|
44
|
-
|
|
47
|
+
liteMode: isLite,
|
|
48
|
+
// Preset Lite Mode (Hemat RAM & CPU)
|
|
49
|
+
...(isLite ? {
|
|
50
|
+
syncFullHistory: false,
|
|
51
|
+
markOnlineOnConnect: false,
|
|
52
|
+
generateHighQualityLinkPreview: false,
|
|
53
|
+
keepAliveIntervalMs: 30_000,
|
|
54
|
+
logger: pino({ level: "silent" })
|
|
55
|
+
} : {
|
|
56
|
+
logger: pino({ level: "silent" })
|
|
57
|
+
}),
|
|
45
58
|
browser: Defaults_1.DEFAULT_CONNECTION_CONFIG.browser,
|
|
46
59
|
...options
|
|
47
60
|
};
|