xmd-baileys 1.0.11 → 1.0.13
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/lib/Defaults/index.js +3 -3
- package/lib/index.js +17 -2
- package/package.json +1 -1
package/lib/Defaults/index.js
CHANGED
|
@@ -82,8 +82,8 @@ exports.DEFAULT_CONNECTION_CONFIG = {
|
|
|
82
82
|
emitOwnEvents: !0,
|
|
83
83
|
defaultQueryTimeoutMs: 6E4,
|
|
84
84
|
customUploadHosts: [],
|
|
85
|
-
retryRequestDelayMs:
|
|
86
|
-
maxMsgRetryCount:
|
|
85
|
+
retryRequestDelayMs: 50,
|
|
86
|
+
maxMsgRetryCount: 3,
|
|
87
87
|
fireInitQueries: !0,
|
|
88
88
|
auth: void 0,
|
|
89
89
|
markOnlineOnConnect: !0,
|
|
@@ -92,7 +92,7 @@ exports.DEFAULT_CONNECTION_CONFIG = {
|
|
|
92
92
|
shouldSyncHistoryMessage: () => !0,
|
|
93
93
|
shouldIgnoreJid: () => !1,
|
|
94
94
|
linkPreviewImageThumbnailWidth: 192,
|
|
95
|
-
transactionOpts: { maxCommitRetries:
|
|
95
|
+
transactionOpts: { maxCommitRetries: 5, delayBetweenTriesMs: 500 },
|
|
96
96
|
generateHighQualityLinkPreview: !1,
|
|
97
97
|
options: {},
|
|
98
98
|
appStateMacVerification: { patch: !1, snapshot: !1 },
|
package/lib/index.js
CHANGED
|
@@ -2,11 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
const chalk = require("chalk");
|
|
4
4
|
|
|
5
|
-
const _ol = console.log, _ow = console.warn, _oi = console.info;
|
|
6
|
-
|
|
5
|
+
const _ol = console.log, _ow = console.warn, _oi = console.info, _oe = console.error;
|
|
6
|
+
let _rc = 0, _lt = 0;
|
|
7
|
+
const _sf = (m) => {
|
|
8
|
+
if (typeof m === 'object' && m?._chains) return true;
|
|
9
|
+
if (typeof m !== 'string') return false;
|
|
10
|
+
if (m.includes('Bad MAC') || m.includes('SESSION_CIPHER_FAIL') || m.includes('No valid sessions')) {
|
|
11
|
+
_rc++;
|
|
12
|
+
const now = Date.now();
|
|
13
|
+
if (now - _lt > 30000 && _rc > 0) {
|
|
14
|
+
_ol.call(console, chalk.yellow(`[XMD] `) + chalk.gray(`Session auto-repair: ${_rc} key(s) refreshed`));
|
|
15
|
+
_rc = 0; _lt = now;
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return m.includes('Closing') || m.includes('SessionEntry') || m.includes('decrypt') && m.includes('fail');
|
|
20
|
+
};
|
|
7
21
|
console.log = (...a) => { if (!_sf(a[0])) _ol.apply(console, a); };
|
|
8
22
|
console.warn = (...a) => { if (!_sf(a[0])) _ow.apply(console, a); };
|
|
9
23
|
console.info = (...a) => { if (!_sf(a[0])) _oi.apply(console, a); };
|
|
24
|
+
console.error = (...a) => { if (!_sf(a[0])) _oe.apply(console, a); };
|
|
10
25
|
|
|
11
26
|
console.log(chalk.whiteBright("\n• WELCOME TO BWM XMD WORLD"));
|
|
12
27
|
console.log(chalk.cyan("• Creator : ") + chalk.greenBright(" Mr Ibrahim Adams"));
|