xmd-baileys 1.0.7 → 1.0.8
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/index.js +14 -8
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2,17 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
const chalk = require("chalk");
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
console.log = function(...args) {
|
|
7
|
-
const msg = args[0];
|
|
5
|
+
const sessionFilter = (msg) => {
|
|
8
6
|
if (typeof msg === 'string' && (
|
|
9
7
|
msg.includes('Closing open session') ||
|
|
10
|
-
msg.includes('Closing session
|
|
11
|
-
msg.includes('
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
msg.includes('Closing session') ||
|
|
9
|
+
msg.includes('Closing stale open session') ||
|
|
10
|
+
msg.includes('SessionEntry') ||
|
|
11
|
+
msg.includes('Bad MAC')
|
|
12
|
+
)) return true;
|
|
13
|
+
if (typeof msg === 'object' && msg?._chains) return true;
|
|
14
|
+
return false;
|
|
15
15
|
};
|
|
16
|
+
const originalLog = console.log;
|
|
17
|
+
const originalWarn = console.warn;
|
|
18
|
+
const originalInfo = console.info;
|
|
19
|
+
console.log = function(...args) { if (!sessionFilter(args[0])) originalLog.apply(console, args); };
|
|
20
|
+
console.warn = function(...args) { if (!sessionFilter(args[0])) originalWarn.apply(console, args); };
|
|
21
|
+
console.info = function(...args) { if (!sessionFilter(args[0])) originalInfo.apply(console, args); };
|
|
16
22
|
|
|
17
23
|
console.log(chalk.whiteBright("\n• WELCOME TO BWM XMD WORLD"));
|
|
18
24
|
console.log(chalk.cyan("• Creator : ") + chalk.greenBright(" Mr Ibrahim Adams"));
|