rixleys 1.0.0 → 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 +4 -2
- package/lib/Socket/groups.js +3 -0
- package/lib/Socket/index.js +14 -1
- package/package.json +2 -2
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
|
|
@@ -138,9 +139,10 @@ await sock.updateGroupSubject(chatId, "Nama Baru");
|
|
|
138
139
|
await sock.updateGroupDescription(chatId, "Deskripsi Baru");
|
|
139
140
|
|
|
140
141
|
// Kirim Status / Cerita Grup (SWGC - Group Status V2)
|
|
142
|
+
// (Bisa pakai: sock.sendStatusGc / sock.sendStatusGroup / sock.sendGroupStatus)
|
|
141
143
|
await sock.sendStatusGc(chatId, { text: "Pengumuman di Status Grup!" });
|
|
142
|
-
await sock.
|
|
143
|
-
await sock.
|
|
144
|
+
await sock.sendStatusGroup(chatId, { image: imageBuffer, caption: "Foto status grup" });
|
|
145
|
+
await sock.sendGroupStatus(chatId, { video: videoBuffer, caption: "Video status grup" });
|
|
144
146
|
await sock.sendStatusGc(chatId, { audio: audioBuffer, ptt: true });
|
|
145
147
|
```
|
|
146
148
|
|
package/lib/Socket/groups.js
CHANGED
|
@@ -354,6 +354,9 @@ const makeGroupsSocket = (config) => {
|
|
|
354
354
|
},
|
|
355
355
|
sendGroupStatus: async (chatId, content, options = {}) => {
|
|
356
356
|
return sock.sendStatusGc(chatId, content, options);
|
|
357
|
+
},
|
|
358
|
+
sendStatusGroup: async (chatId, content, options = {}) => {
|
|
359
|
+
return sock.sendStatusGc(chatId, content, options);
|
|
357
360
|
}
|
|
358
361
|
};
|
|
359
362
|
};
|
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
|
};
|